Images Break when Moving Between Groups

Hello,

I recently moved some images from one group to another in tandem with moving some pages across groups. I checked the moved pages to find the images added to the pages were broken. I edited the page to reassign them, and they work fine now, but it still seemed odd.

Looking a bit more closely, I noticed that the URL for images has the gid in it:

https://www.beloit.edu/live/image/gid/37/width/701/height/467/crop/1/src_region/0,1206,1999,2538/13402_meeting-friends-college-street.webp

I suspect the gid mismatch– the original group doesn’t have this image– caused the broken images I saw.

Is the gid really necessary? The URL has the unique ID to get the single image, and images don’t appear to be sharable across groups to merit a per-group distinction. Maybe for more efficient lookup of images (search group, not all) when displaying?

In any case, sharing this as a potential pain point.

Thanks,
Nick

Lol. I literally just dealt with the same thing 10 minutes ago. Another LW admin was moving pages and associated images to a new group, and all of the images broke. I helped her by running find/replace in the source code to update the gid from the old to the new group.

It makes me wonder why we even have the ability to move images to new groups with the potential for breaking things like this.

Huh, that’s interesting – I thought the reference to an image used on an editable LiveWhale CMS page source was in the format <widget type="image"><arg id="id">etc..... and got translated to the /URL version that includes /gid/ only in the page rendering steps. I wonder how /live/image/gid/etc… got into the page source to begin with.

If one of you wants to provide steps to reproduce this for us, we can check it out on one of our test servers. Apologies for the inconvenience in the meantime. Thanks!

I’m not sure if its just the image moving, or if its the page and image moving together.

  1. In Group A, upload image(s).
  2. In Group A, create a page and add the image(s) to it.
  3. In the backend, move the page from Group A to Group B (change directory).
  4. In the backend, move the image(s) from Group A to Group B.
  5. Check the page: the images should be broken.

Thanks,
Nick

Nick’s steps are correct, but moving the page is not necessary. I just tested it (minus step 3) and it created a broken image.

Before:

After:

1 Like

When you first add an image to a page, the <widget> code looks like this, with no reference to the group id:

But after saving the page, and re-editing it, the <widget> code looks like this…

The <arg id="cache"> contains urls with gid in them.

Ah, thanks, it sounds like that cache entry needs to get cleared when moving an image between groups. I’ll flag this for the team, thanks!

Thanks again for bringing this to our attention, folks – we’ve got a fix for this incorporated into core that’ll get bundled with our next release.

1 Like