[TYPO3-irre] IRRE + dbal without pid :)

Oliver Hader oh at inpublica.de
Thu May 3 14:53:13 CEST 2007


Hi Nikolas,

Nikolas Hagelstein wrote:
> Oliver Hader wrote:
>> There is a hook in TCEforms "getMainFields_preProcess". You could use
>> this one to fake the pid of the parent/child record to the fixed
>> value "76". Doing this should also prevent from screwing up the
>> variable "inlineFirstPid" with nonsense.   
> Did that already and it worked. :)
> But there is one issue left you probably could gimme a hand on:
> The parent record isnt allowed to be save (readonly) but due to the fact
> that
> Inline childs get added at "saving time" i set :
> $fieldArray = 0 withing processDatamap_postProcessFieldArray.
> According to:
> http://doxygen.frozenkiwi.com/typo3/html/dd/da6/class_8t3lib__tcemain_8p
> hp-source.html#l00775
> 
> This should prevent the record from being saved.
> 
> I works quite well execpt for one thing:
> If i add new an inline child to the parent record the parent records
> "save" routine gets trigger anyway.
> Any ideas?

Yepp... if the parent relates to unsaved (new) child records there will
be an entry on $this->remapStack in TCEmain. This stack will be
processed if all children have been saved and afterwards the parent
record gets updated by calling t3lib_TCEmain::updateDB(). Unfortunatelly
this method doesn't have any hooks.
A dirty workaround could be to use any of the processDatamap_* hooks to
revert the entry for the parent table on $this->remapStack.

Using processDatamap_afterDatabaseOperations might no be a good idea,
but give it a try. There is pending bugfix for this hook - have a look:
http://bugs.typo3.org/view.php?id=5074

>> I didn't test it, but I think it could work. To get this working
>> without the disposal of hooks IMO the DBAL should add the pid
>> virtually to records if it's defined in the mapping.  
> Yes right but DBAL isnt aware of virtuall fields yet.

So go ahead with a feature request for DBAL in bugtracker if you'd like
to see this one day... ;-)


olly
-- 
Oliver Hader
http://inpublica.de/


More information about the TYPO3-project-irre mailing list