[TYPO3-dev] Using the linkvalidator for a field with internal type "file_reference"
Philipp Gampe
philipp.gampe at typo3.org
Fri Apr 27 17:25:51 CEST 2012
Hi Ivan,
I finally managed to have a look at this.
Ivan Ruiz Gallego wrote:
> 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,
> )
> ),
You need a 'softref' => 'typolink', here.
And of course you need to add the TSconfig:
mod.linkvalidator {
searchFields {
tx_lllibertydocs_dokumente = file
}
}
> 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.
Must be typolink if you want to work with files:
http://typo3.org/documentation/document-library/core-
documentation/doc_core_tca/4.7.1/view/1/4/#id592069
> 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?
Actually I am not sure if we should just search fields without softref
anyway. Or just assume typolink if nothing is set, because it should work
almost always out of the box.
Also I am unsure whether this is a feature or a bug. It is kind of both :)
Best regards
--
Philipp Gampe – PGP-Key 0AD96065 – TYPO3 UG Bonn/Köln
Documentation – linkvalidator
TYPO3 .... inspiring people to share!
More information about the TYPO3-dev
mailing list