Closed (fixed)
Project:
Entity Dependency API
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Feb 2012 at 23:41 UTC
Updated:
5 Mar 2012 at 05:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
neochief commentedComment #2
neochief commentedI'm not sure how it intended to be, but maybe the better option is to have dependancies actually keyed as IDs.
Comment #4
neochief commentedThere's one more issue with iterator. For example, if you have a teaxonomy term, which is a child of another term and they both related to separate nodes in deployment plan, there will be a case, when parent term will get to traversed items faster then the rest of it's node terms, causing all of them skipped due to expression in valid(). To solve this, we need to skip all traversed items, but not terminate loop on them.
Comment #5
neochief commentedBy the way, I've also found, that origin of a term, which originally created from node might be re-written by it's parent term. Since origin is not used anywhere, it's not critical, but it may cause some issues later.
Comment #7
neochief commentedThis one should be final. I've find a better way to handle problem, than in last patch + updated tests (they fail with old code base).
Comment #8
vladsavitsky commented+1. Commit it please.
Comment #9
neochief commentedIt turns out that next() should be changed as well to catch some test circumstances. Tests & codeupdated.
Comment #10
neochief commentedI've found additional usecase in which iterator may fail: if some module will add the same entity as top item to dependencies, we won't be able to remove it on reset stage. So, we should get rid of it earlier.
Comment #11
dixon_Thanks neochief for you work on this (and all the other issues ;)).
I've committed the patch with some very minor code style fixes.
Comment #12
neochief commentedActually, this is not the end. Yesterday I've rewritten the iterator's structure, as even with latest patches it fails from time to time.
Example:
- Node A
- Node B, translation of A
- User U, author of A
iterator(A)
Curent iterator will try traverse a tree like this:
level #1
nodes:
-Node A
level #2
nodes:
--Node B
--Node A // added to the node type sub tree as parent
users:
--User U // but user is still in the trail
As you see from above, user will still be below it's parent node.
I've changed the way iterator builds a tree and got rid of entity type subtrees. Instead entities are listed in each pass as simple list of arrays, containing the data about an item:
level #1
(0 => array(id => A, type => node))
level #2
(0 => array(id => B, type => node))
(1 => array(id => U, type => user))
(2 => array(id => A, type => node))
The patch requires updating Entity dependency API and Deploy module. Since you're the author, I'm posting both here.
Comment #13
neochief commentedSorry, last patch included some additional code from books support, not relevant to this issue. New version attached. Deploy's patch was ok.
Comment #14
neochief commentedComment #16
dixon_Hm, yeah I've had this limitation in mind as well at some point. But I never ran into the problem, so I guess I never fixed it :)
The approach looks good, but I have to look deeper into it. But before we commit anything, I'd like to have passing tests for everything.
Comment #17
neochief commentedI've committed the full fix to both modules, included extended tests to the module. Here are commits:
http://drupalcode.org/project/entity_dependency.git/commit/66394f3
http://drupalcode.org/project/deploy.git/commit/d0b9b6a
Comment #18
dixon_Awesome! neochief++++