plainblack.com
Username Password
search
Bookmark and Share
View All Tickets
asset addChild failure when parent is not committed  (#11295)
Issue

If you have the latest version of an asset and it is not committed, addChild fails at fixUrl (build a URL from the parent) if you do not supply your own url argument.  This results in a fatal error.

If you supply the url parameter to the addChild method, the child is added to the parent lineage and also added to the version tag of the parent as expected.

Solution Summary
Comments
perlDreamer
0
12/7/2009 10:22 pm
Would you please also include the snippet of code, and the goal of the custom code that you're writing.  As stated, this is not yet a reproducible bug.
sno
0
12/14/2009 9:06 am
Say you have an asset that can only be found by the latest revisionDate (through newPending because newByDynamicClass will not return pending assets).  You use addChild to attach an asset to it and join it to the parent version tag.  If you do not include your own 'url' parameter, a call is made through fixUrl to $self->getParent->get('url') to build the url for the child asset.  Unfortunately getParent uses newByDynamicClass always, and can not find the parent.

Two things bad are happening here.

First $self->getParent->get('url') always assumes getParent success, even on pending parent assets.  When the parent asset is not committed, getParent returns undef, then a get is applied to that.

Second, should not getParent be able to process both committed and uncommitted assets; uncommitted perhaps by call flag?
perlDreamer
0
12/14/2009 10:19 am
newByDynamicClass _will_ return uncommitted assets, if the pending asset is in your current version tag.  This means that through the UI, the situation will never occur, since an pending asset won't be displayed to a user who isn't in the version tag.  It will only happen in custom code.
sno
0
12/14/2009 10:37 am
It is a simple check to have fixUrl determine getParent definedness and do something intelligent before proceeding.  It will prevent issues in custom code.
perlDreamer
0
12/15/2009 4:23 pm
Changed addRevision to temporarily adopt an uncommitted parent's version tag, if the parent does not have any committed revision in the database.

Fixed in 7.8.8 (310c0ad)
Fixed in 7.7.29 (99e5aab)
Details
Ticket Status Resolved  
Rating0.0 
Submitted Bysno 
Date Submitted2009-12-07 
Assigned To unassigned  
Date Assigned2019-08-22 
Assigned By 
Severity Cosmetic (misspelling, formatting problems)  
What's the bug in? WebGUI Stable  
WebGUI / WRE Version core  
URLuse/bugs/tracker/11295
Keywords
Ticket History
12/15/2009
10:23 PM
Resolved perlDreamer
12/14/2009
3:06 PM
Pending sno
12/8/2009
4:22 AM
Feedback Requested perlDreamer
12/8/2009
4:22 AM
Resolved perlDreamer
12/7/2009
7:05 PM
Ticket created sno
© 2019 Plain Black Corporation | All Rights Reserved