[TYPO3-dev] Using the linkvalidator for a field with internal type "file_reference"

Ivan Ruiz Gallego ivan at loglan.net
Mon Apr 16 16:23:39 CEST 2012


Dear Philipp,

Did you take a look at the issue below?

Thanks
Ivan

On 28.03.2012 09:22, Ivan Ruiz Gallego wrote:
> Hi Philipp,
>
> You can download the extension using the link below. The extension is
> not documented yet.
>
> http://www.loglan.net/fileadmin/pgampe/T3X_ll_liberty_docs-0_1_3-z-201203280858.t3x
>
>
> I already took a look at the analyzeRecord() function. In my opinion,
> the TCA field configuration must fulfil the condition below in order to
> get analysed / recognised by the linkvalidator extension.
>
> if ($conf['softref'] && strlen($valueField))
>
> In my case this condition is not met. My TCA configuration for the field
> "file" looks like this:
>
> 'file' => array (
> 'exclude' => 1,
> 'label' =>
> 'LLL:EXT:ll_liberty_docs/locallang_db.xml:tx_lllibertydocs_dokumente.file',
> 'config' => array (
> 'type' => 'group',
> 'internal_type' => 'file_reference',
> 'allowed' => 'pdf, ppt, jpeg, png, gif',
> 'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
> 'size' => 6,
> 'minitems' => 0,
> 'maxitems' => 6,
> )
> ),
>
> I've just tried to add the a 'softref' => 'url' to the configuration
> above. Within analyzeRecord() the condition above is met, but
> $resultArray resulting from parsing the soft reference is NULL.
>
> I don't know if this behaviour is a bug of the link validator extension.
> To me it seems more like a feature, which might be added to it.
>
> What do you think about it?
>
> Regards
> Ivan
>
>
>
>
> On 27.03.2012 18:39, Philipp Gampe wrote:
>> Hi Ivan Ruiz Gallego,
>>
>> Ivan Ruiz Gallego wrote:
>>
>>> I have programmed an extension for simple document management. A
>>> database table contains document records. The field "file" contains the
>>> path (relative to web root) to the document. This field is configured
>>> (TCA) with a type "group" and an internal type "file_reference".
>>> Additionally, I have configured the link validator using the PageTS
>>> accordingly.
>>>
>>> I renamed some of the files referenced by document records (i.e. I
>>> deliberately generated some error cases). Unfortunately, the link
>>> validator didn't detect these errors. After checking my configuration, I
>>> took a look at the source code of the link validator and got the
>>> impression that the validator ignores this kind of fields. Can anyone
>>> confirm this impression?
>>
>> I have not tried yet, but the magic happens in the analyzeRecord()
>> function
>> in tx_linkvalidator_processor.php.
>>
>> Would you mind sending me your extension, then I can have a look at it
>> and
>> see if there is a simple fix for linkvalidator.
>>
>> BTW, it seems that linkvalidator read some softref entry from TCA:
>> $conf = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
>> that should look like this:
>> $TCA['tt_content']['columns']['bodytext']['config']['softref'] =
>> 'typolink_tag,images,email[subst],url';
>>
>> If you can confirm that this is a bug, please file a bug report at:
>> http://forge.typo3.org/projects/extension-linkvalidator/issues
>>
>> Best regards
>




More information about the TYPO3-dev mailing list