[TYPO3-core] IRRE implementation bugs
Kasper Skårhøj
kasper2007 at typo3.com
Mon Oct 15 17:41:27 CEST 2007
Hi Folks,
Attention Dmitry and Oliver Hader!
(And Dmitry, I'm going to expose some mistakes you have made, I don't
intend that to offend you, so please don't be ;-)
I have largely been left out of the IRRE development but I have at
various occasion looked at the implementation, especially related to
workspaces, and shivered a bit because I felt something was wrong
conceptually. I didn't actually look into these cases to understand
them because I didn't have time. But for instance it's my impression
that if you create a new version of an IRRE "parent" record that it
automatically makes versions of the related records. This is not how
versioning should work in TYPO3. A version is created with a single
element, unless "page" or "branch" versioning are used. Letting an
"element" version result in a chain of new versions under the hood is
NOT warranted. On the TYPO3 core level IRRE is just a clever way
interface wise to edit records which are "one object" seen with the
users eyes. Inside TYPO3s core they are NOT one object and should be
treated correspondingly as individual elements. If we wish to make
them versioned all together we must invent a meta-concept for
grouping versions somehow. This could be useful for other things too,
for instance someone wanted a new element verison of a page to
trigger element versions of all content elements on the page - well,
ok, then but we must invent a new meta-concept for this. So far my
concerns with IRRE in general, forgive me if I am not right about the
implementation, after all I just concluded from the core.
Anyway, today I'm at Dassault and found that in a case where are
least some IRRE related implementation made by Dmitry in revision
2319 has broken the concept of foreign records. I experienced it like
this and I think you can easily reproduce the problem:
Here is a FCE with Data Structure and TemplateObject:

As soon as I made a change in the workspace a new version was made of
course BUT the Data Structure and Template Object selectors reported
"Invalid value" and didn't list my DS and TO's. Why? Well, because
Dmitry made a conceptually faulty change in revision 2319. This
change is attached as a patch file and I intend to revert this unless
someone can argue against it.
But of course let me comment on why this is wrong.

The problem is that if the master record (here my FCE) turns out to
be a version in a workspace it will look up the list of foreign
records completely differently. Lets recap how foreign records are
normally looked up:
... (line 48 in patch):
WHERE' => 'pages.uid='.$foreign_table.'.pid
...
Of course we look them up as paired to a live page. (In fact we must
NEVER select a version with pid=-1 without first selecting its live
record!! Dmitry has confused this before in our debate on element/
page/branch versioning in may/june).
But if the master record is a version it will instead look it up like
this:
... (line 75-76 in patch)
$foreign_table . '.pid=-1 AND ' .
$foreign_table . '.t3ver_wsid=' . $wsid .
...
Ergo, we select directly from offline records which is by definition
forbidden. The right way is to first select the live record, then
look for an overlay record.
I can't say exactly what the wanted effect for IRRE shoudl be but
definitely this is wrong and gotta be a bug lots of people are having
with workspaces now.
Conclusions:
- Remember, since August I'm the authority on versioning and
workspaces and I must approve any non-trivial change to these parts.
This is to avoid these situations because we have realized that the
core team as a unit doesn't understand this technology well enough to
maintain it error-free.
- Question: Are you sure IRRE is conceptually sound? Did any of my
concerns ring true?
- Please make sure to cc me privately if you want to make sure I read
core list mails ( I don't read the list regularly)
- I will revert this code issue
- kasper
-----------------------------------------------------
How many women does it take to get a baby in 1 month?
Kasper Skårhøj
Tryggevældevej 8
2720 Vanløse
+45 20 999 115
skype : kasperskaarhoej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20071015/6d351a32/attachment-0003.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedGraphic.tiff
Type: image/tiff
Size: 56610 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20071015/6d351a32/attachment-0001.tiff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20071015/6d351a32/attachment-0004.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: revision2319.diff
Type: application/octet-stream
Size: 4990 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20071015/6d351a32/attachment-0001.obj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20071015/6d351a32/attachment-0005.htm
More information about the TYPO3-team-core
mailing list