#1753 Caching of images in Articles broken

v1.8.4
closed
5
2004-11-23
2004-11-22
Josh Burley
No

It seems that when an image is cached in an Article, it
gets replaced incorrectly.

With img src="http...." or img src="images/....", the
URL that it gets replaced with is incorrect (this does
not happen with image links such as img src="/images/...").

The URI that gets put in it's place is one to
tiki-edit_article.php, rather than to show_image.php.

I traced this bug down, and it looks to be a problem in
lib/imagegals/imagegallib.php, line 1361.

At this line it's attempting to replace "tiki-editpage"
in the current URL to "show_images". However, the page
the user is on is "tiki-edit_article.php", so this
replace never happens, and the URL for the image
remains pointed to tiki-edit_article.php.

I'm surprised that I was unable to find a bug report
for this, as I'd expect this problem to be a pretty big
one. I also checked the CVS version of this file, and
it too seems to be hard coded to tiki-editpage.

Discussion

  • Sylvie Greverend

    Logged In: YES
    user_id=784615

    Thanks for reporting and explaining the fix. Done in 1.8 CVS.
    sylvie

     
  • Sylvie Greverend

    • assigned_to: nobody --> sylvieg
    • status: open --> closed
     
  • Josh Burley

    Josh Burley - 2004-11-23

    Logged In: YES
    user_id=1156185

    Awesome!

    Do you know where I can find that change? I went through CVS
    at SF.net but could not find it in any of the branches/tags
    I checked. Nor could I find it in any recent changelogs...

    Thanks again!

     
  • Josh Burley

    Josh Burley - 2004-11-23

    Logged In: YES
    user_id=1156185

    Ah, sorry. Thanks for the diff... though I think it might be
    useful to do this a bit more dynamically. I'd like to use
    the same "cache all images in this string of data" for a
    Galaxia workflow. I will see if I can put together a patch
    that works for any URI.... but...

    Perhaps I have a new, related problem. It now changes the
    URL's correctly while editing Articles, but the image is not
    showing up.... The URL gets changes to show_image.php, but
    if I try to go to that page in a separate window, instead of
    the picture I'd expect, I get the error (code 416):

    Requested Range Not Satisfiable

    None of the range-specifier values in the Range
    request-header field overlap the current extent of the
    selected resource.

    Any ideas? The data looks to be in tiki_images_data fine.
    It's also a .BMP if that makes any difference (the headers
    and values in the DB look fine... and this works when it's
    not cached).

     
  • Josh Burley

    Josh Burley - 2004-11-23

    Logged In: YES
    user_id=1156185

    Oh, and it looks like that patch will break caching in Pages.

    The line that was added should read:

    $path = str_replace("tiki-edit_article", "show_image", $path);

    Or else you'd lose the replace that was done for tiki-editpage.

    I'm working on a version that is not hardcoded for those
    URI's, and will post a patch once it's tested out.

     
  • Sylvie Greverend

    Logged In: YES
    user_id=784615

    Thanks again... and sorry for the bug (I hate to patch in a
    release I don't use...). Fixed in 1.8 cvs.
    I agree that it is not a pretty patch... needs to be more
    dynamic
    If you want to join us in the devel team, you are welcome,
    just tell me ... You can surely do a better job than the one
    I did for this problem ;-)
    sylvie

     
  • Josh Burley

    Josh Burley - 2004-11-26

    Logged In: YES
    user_id=1156185

    Sure, I'd love to join. I have a number of patches posted to
    the Patches area, too, that I think would be useful.

    I have a more dynamic solution, now, which will work for any
    page/uri. It's at the office, though, so I won't have access
    to it until Monday.

     
  • Sylvie Greverend

    Logged In: YES
    user_id=784615

    I added your name in tikiwiki SF.
    Be sure to read the 3 rules
    http://tikiwiki.org/tiki-index.php?page=3Rules
    It is the only rules we have but we are very strict about them.
    Welcome
    sylvie

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks