View Full Version : Image linking not working
phuqmnb
03-14-2007, 03:00 PM
I am attempting to link an image file that I have uploaded to a page (share.png). What I am trying to do is create links to images on an intranet DekiWiki site.
Something like linking an image (e.i. Share.png, Share2.png, etc.) file to the text Fig. 1-1, etc.
After I go through the section linking the correct images to the text (I also verify it is going to the correct image), I save it. Then something happens where it changes the image I have it linked to and makes them all go to the same image (e.i. Share.png).
PeteE
03-15-2007, 04:59 AM
I am attempting to link an image file that I have uploaded to a page (share.png). What I am trying to do is create links to images on an intranet DekiWiki site.
phuqmnb - Yes this is a bug. rrusso also brought this to my attention and I've been working on a fix. There's a bug with the link cache that appears to only happen with certain versions of PHP. I should have a patch within the next 2 days.
Thanks for reporting it!
phuqmnb
03-15-2007, 02:10 PM
phuqmnb - Yes this is a bug. rrusso also brought this to my attention and I've been working on a fix. There's a bug with the link cache that appears to only happen with certain versions of PHP. I should have a patch within the next 2 days.
Thanks for reporting it!
Thanks for the update.
Have you any other ideas on my other problem with mwlucene? (this is Mike btw)
PeteE
03-15-2007, 11:04 PM
-----------
UPDATE: Use the attached patch file below (http://forums.opengarden.org/attachment.php?attachmentid=1&d=1174059746) Copying/pasting this text doesn't work due to issues with windows line feeds.
-----------
To fix this please apply the following patch (/includes/Attach.php). I'll get this packaged up and into a new release shortly...
--- Attach.php 2007-03-15 16:54:47.000000000 -0500
+++ Attach.php.new 2007-03-15 16:54:40.000000000 -0500
@@ -1084,7 +1084,7 @@
function getFileTitle($full_name, $topicName) {
global $wgCanonicalNamespaceNames;
- $nt = Title::newFromText($wgCanonicalNamespaceNames[NS_ATTACHMENT] . ':a');
+ $nt = Title::newFromText($full_name, NS_ATTACHMENT, $topicName);
$nt->mDbkeyform = trim($topicName,'/') . '/' . $full_name;
$nt->mTextform = str_replace('_',' ', $nt->mDbkeyform);
return $nt;
You should be able to apply this by:
cd /var/www/<yourwiki>/includes
patch -p0 < /path/to/Attach.php.patch
phuqmnb
03-16-2007, 12:47 PM
To fix this please apply the following patch (/includes/Attach.php). I'll get this packaged up and into a new release shortly...
--- Attach.php 2007-03-15 16:54:47.000000000 -0500
+++ Attach.php.new 2007-03-15 16:54:40.000000000 -0500
@@ -1084,7 +1084,7 @@
function getFileTitle($full_name, $topicName) {
global $wgCanonicalNamespaceNames;
- $nt = Title::newFromText($wgCanonicalNamespaceNames[NS_ATTACHMENT] . ':a');
+ $nt = Title::newFromText($full_name, NS_ATTACHMENT, $topicName);
$nt->mDbkeyform = trim($topicName,'/') . '/' . $full_name;
$nt->mTextform = str_replace('_',' ', $nt->mDbkeyform);
return $nt;
You should be able to apply this by:
cd /var/www/<yourwiki>/includes
patch -p0 < /path/to/Attach.php.patch
I get this error:
patching file Attach.php
patch unexpectedly ends in middle of line
Hunk #1 FAILED at 1084.
1 out of 1 hunk FAILED -- saving rejects to file Attach.php.rej
Bizzz
03-16-2007, 01:21 PM
Same error for me.
I've manually replace the modified line into Attach.php.
phuqmnb
03-16-2007, 01:31 PM
Where in that file is the section that needs replaced?
Bizzz
03-16-2007, 02:28 PM
The line to replace is line 1087.
Old value is
$nt = Title::newFromText($wgCanonicalNamespaceNames[NS_ATTACHMENT] . ':a');
Replacement value is
$nt = Title::newFromText($full_name, NS_ATTACHMENT, $topicName);
PeteE
03-16-2007, 03:43 PM
It looks like there's a problem with the windows line-feed characters causing the patch to bork. Stupid windows line feeds!
Try using the attached patch file instead...
phuqmnb
03-19-2007, 08:06 PM
It looks like there's a problem with the windows line-feed characters causing the patch to bork. Stupid windows line feeds!
Try using the attached patch file instead...
Thanks!!
I just replaced line 1087, so I don't know if this works or not.
javiersp
11-26-2007, 04:00 PM
Hi,
Not working on my case...both IE7 and Firefox, cache cleared, etc, etc.
Regards.
brigettek
11-26-2007, 05:34 PM
Can you include an example of page content that reproduces the issue?
javiersp
11-27-2007, 08:09 AM
Hi briggetek,
Source with first image attached (before the error):
<h1> Any Page</h1>
<p>Any content 1</p>
<p> <img align="left" src="http://192.168.0.129/File:./flower.jpg&contextid=235&action=thumb&size=full" style="height: 611px; width: 335px;" alt="./flower.jpg" size_type="direct" ialign="lnowrap" /></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>Any content 2</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
And source once the second image is attached:
<h1>Any Page</h1>
<p>Any content 1</p>
<p> <img align="left" src="http://192.168.0.129/File:./flower.jpg&contextid=235&action=thumb&size=full" style="height: 611px; width: 335px;" alt="./flower.jpg" size_type="direct" ialign="lnowrap" /></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>Any content 2</p>
<p><img align="left" src="http://192.168.0.129/File:./flower2.jpg&contextid=235&action=thumb&size=full" ialign="lnowrap" size_type="direct" alt="./flower2.jpg" style="height: 300px; width: 400px;" /> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
The source looks ok, but once this is saved, second image prevails...
¿Should you please send me teh complete Attach.php sources? Maybe I'm doing something wrong while patching.
Lots of thanks.
brigettek
11-27-2007, 06:10 PM
This sounds very similar to http://forums.opengarden.org/showthread.php?t=1017. This issue was a MySQL database query that caused incorrect lookups of files and images in some cases. We released a fix for this with Hayes 1.8.2b.
Can you check your Deki Wiki version under Tools->About to verify you have 1.8.2b or later? If you have the latest version and problems persist, you could see if you're able to repro on our wiki at http://wiki.opengarden.org/User:Brigettek (I wasn't able to get a repro but I might still be missing something).
javiersp
11-29-2007, 10:35 AM
Hi Briggetek:
This sounds very similar to http://forums.opengarden.org/showthread.php?t=1017. This issue was a MySQL database query that caused incorrect lookups of files and images in some cases. We released a fix for this with Hayes 1.8.2b.
Our version is:
You are using Deki Wiki 1.8.2b (rev. 7558) running on: Linux 2.6.18-4-686, PHP 5.2.0-8+etch7, mySQL 14.12 distribution 5.0.32, and Mono 1.2.2.1.
Being your version 1.8.2 multi (rev. 6225), it was supposed to be fixed, as you commented.
Can you check your Deki Wiki version under Tools->About to verify you have 1.8.2b or later? If you have the latest version and problems persist, you could see if you're able to repro on our wiki at http://wiki.opengarden.org/User:Brigettek (I wasn't able to get a repro but I might still be missing something).
Tried. It works perfect on your site...should you please send us the proper Attach.php? we will try to update the whole file nstead of editing it...
Thanks in advance and best regards.
brigettek
11-29-2007, 07:44 PM
That is really strange. I don't think that we have touched anything since 1.8.2b that would have affected this behavior. :confused:
Sending just the Attach.php would not work since a lot of things have been changing in multi. We will be pushing out a December update with the changes.
I still wish i understood why this is happening on your wiki. If you're up for it, you could use Fiddler to capture the content of the POST: pages/=xxx/contents request to save the page and post it here - that would narrow down whether the issue is occurring within the editor or on the API side.
Powered by vBulletin™ Version 4.1.3 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.