[TYPO3-mvc] setRespectEnableFields ignored in MM relations

Gianluca Strafella gianluca.strafella at webformat.com
Thu Sep 19 08:57:02 CEST 2013


Hi Tomita,
I'm not sure I understand your problem ...  in wich Repository you have 
implemented method initializeObject() ?

If your code is in ContactRepository your Contact(s) should be retrieved 
less field "hidden".

So the query should be similar to this:

SELECT tx_yourext_domain_model_contact.* FROM 
tx_yourext_domain_model_contact WHERE
[all_clause]

where [all_clause] will contain sys_language and pid conditions but NOT 
"hidden" condition.

So, all  related List(s) (with MM relation) will be searched in table 
tx_yourext_domain_model_list with standard conditions, included 
tx_yourext_domain_model_list.hidden=0 condition.

Is this your case ?

Regards,
Gianluca

Gianluca Strafella

Software Developer
gianluca.strafella at webformat.com
Tel.   +39-0427-926.389

WEBFORMAT srl – www.webformat.com
Via S. Francesco d'Assisi, 6 – 20122 MILANO
Corte Europa, 12 - 33097 SPILIMBERGO (PN)


Il 16/09/2013 17:15, Tomiţă MILITARU ha scritto:
> Hello,
>
> I'm using Extbase 1.4 and I have 2 models: Contact & List, with a MM
> relation.
> Now I want to retrieve all the contacts from a list, even those that are
> hidden. I've tried:
> public function initializeObject() {
>          $querySettings = $this->createQuery()->getQuerySettings();
>          $querySettings->setRespectEnableFields(FALSE);
>          $this->setDefaultQuerySettings($querySettings);
>      }
>
> But this is not applied for MM relations it seems, if I do
> $this->contactRepository->findAll() I get the hidden records.
> Printing out the query I can see that contacts.hidden = 0 is checked.
>
> Any ideea how I can override this or if it is a bug?
>
> Thanks,
> Tomita
>


More information about the TYPO3-project-typo3v4mvc mailing list