Mailing List Archive

[Bricolage #274] Mixing OCs counfuses find_or_create_alternate()
// Add your reply above here
==================================================
bret (at pectopah) updated this ticket at July 15th, 2011 @ 04:32 PM

When the source image and target thumbnail image are in different OCs with different URI formats, calling find_or_create_alternate() will throw a URI-not-unique error.

This is because the URI generated for the initial find uses the source image OC URI format, not the destination URI format.


Here's an example:

The original image is of type "Infrastructure image." That type is in the "Includes" OC, with fixed URI. Here are the URI formats:

/%{categories}/includes/%{slug}/
/%{categories}/includes/%Y/%m/%d/%{slug}/

So the starting URI of my image is this:

/international/includes/a19new.gif


The element type for my thumbnail is "Auto-generated image." Which is in the Web OC, with non-fixed URI, like this:

/%{categories}/%Y/%m/%d/%{slug}/

I'm expecting the thumbnail to have a URI like this:

/international/2011/07/14/a19new_90.gif

...but the lookup inside the find_or_create_alternate comes up with this target URI instead:

/international/includes/2011/07/14/a19new_90.gif

No image with this URI exists, so it goes on to create one. This one has the correct URI, and because the template has run once in the past, it collides with a previously-created version of the same image.
--------------------------------------------------------------------------------

Assigned: Bugs (at bricolage)
State: new
View this ticket online: http://bricolage.lighthouseapp.com/projects/29601/tickets/274-mixing-ocs-counfuses-find_or_create_alternate

Stop being notified of this ticket's changes: http://bricolage.lighthouseapp.com/watching/16a6449f75a1e7433aa98097715e49687be5fb02
Update your Profile: http://bricolage.lighthouseapp.com/profile
Support: support@lighthouseapp.com or http://help.lighthouseapp.com