[TYPO3-core] RFC: Bug #3903, Edit content doesn't work with TV

Bernhard Kraft kraftb at kraftb.at
Tue Sep 18 18:58:25 CEST 2007


Hallo,


This is a SVN patch request.


Branch: trunk


Problem:
When you have only set "Edit page content" as access-right for a page - 
and you are trying to add/delete/move a content element from within the 
templa-voila page-module it will not work.


Reason:
TV stores the references to the used content elements in the flexform 
field tx_templavoila_flex of the page record - when you have not allowed 
to edit the page record (but just "edit content") then it will not work
to add references to new/moved content elements to this field.


Solution:
Add a hook in t3lib_tcemain.php which allows an extension method to 
perform the check if it is valid to modify a specific table.

For this to work properly I had to additionaly pass the modified fields 
to the checkRecordUpdateAccess(...) method. Additionally I have to pass
the "hookObjectsArray" - as I do this by reference and set it "false" at 
the same time this patch also has PHP>=5 as requirement.

I hope this is ok for you ...



Next to the patch for the core there is a patch for the t3lib_tcemain 
hook of templa-voila. It adds the required method which performs the 
check by having a look at the posted data and if only "eType=ce" 
flexfields and no other fields get modified ... i know the code there 
looks a litte bit strange but I couldn't find a better solution. 
Pherhaps one of you has a better idea.


Dmitry: It seems that the source-code files of TV have DOS-style 
newlines currently (\r\n) ... probably this is what your editor creates 
but usually we have just \n (unix) in T3 - I couldn't find a way quickly 
to properly apply the created patch to your class-files except 
converting them to unix-style first (using the tools "dos2unix" 
"unix2dos" ...) - so if you get a hunk failed have a look at the newline 
encoding first ...


Attachment: 2 files - one for the core one for TV


greets,
Bernhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: editContent_TV_core_2007-09-18.diff
Type: text/x-patch
Size: 1817 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070918/77f80986/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: editContent_TV_templavoila_2007-09-18.diff
Type: text/x-patch
Size: 2214 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070918/77f80986/attachment-0001.bin 


More information about the TYPO3-team-core mailing list