Closed (fixed)
Project:
Image Assist
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
7 Dec 2005 at 18:04 UTC
Updated:
24 Mar 2006 at 23:11 UTC
Jump to comment: Most recent file
Hi!
I have created patches for the module to work with the new Forms API and the new code altogether. It's certainly not perfect yet, but it does work (for me at least). I patched 3 files, which I am submitting. Hopefully they will be useful to somebody.
Waldemar
| Comment | File | Size | Author |
|---|---|---|---|
| #42 | files_0.zip | 14.64 KB | Visigotik |
| #41 | files.zip | 5 bytes | Visigotik |
| #33 | img_assist_formsapi_5.patch | 32 KB | Jaza |
| #32 | img_assist_formsapi_v3_v4.diff | 5.21 KB | Jaza |
| #31 | img_assist_formsapi_4.patch | 32.01 KB | Jaza |
Comments
Comment #1
Waldemar commentedPatch #2
Comment #2
Waldemar commentedPatch #3 (This one needs to be applied to the TinyMCE drupalimage module. I did not compress it yet.)
Comment #3
simon rawson commentedIt all works great for me.
One debugging line to be taken out of the first patch at line 89:
+ echo "YEP";but other than that, great. You have saved me a lot of work tonight - I was just about to make a start on it myself... and given that it would have been my first dabbling in the new forms api, you probably did it a lot better and quicker than I would!
Comment #4
Waldemar commentedWhoops,
sorry about the debugging line :). As I said there might be still issues, as I haven't used this module with Drupal 4.6., hence I don't know whether I tested everything.
Other than that I want now to start working on an integration of Menalto Gallery2 into this module, as it would be very helpful to have those images at hand. Suggestions are very welcome.
Comment #5
Waldemar commentedSimon,
also, of course, thanks very much for reviewing and testing!
Comment #6
simon rawson commentedActually found a problem now, although I'm not certain if it is as a result of your patch.
img_assist doesn't appear to be able to use image derivatives other than the thumbnail. They appear in the dropdown menu in the popup, but when the code is inserted the src attribute always links to the thumbnail image.
Can anyone else reproduce this?
Comment #7
Waldemar commentedI'll have a look at it
Comment #8
simon rawson commentedActually, the more I look at this, the more problems I find...
When you click on an image it doesn't populate into the image preview area.
If you choose an alternative derivative (thumbnail, orignal, preview etc) nothing happens. The sizes do not populate into the dimensions fields and the wrong link is returned.
Any description / alt tag information added in the img_assist window does not populate back to the code inserted.
All this is with the "insert html" mode. I haven't looked at the tag/filter option.
Comment #9
simon rawson commentedAny description / alt tag information added in the img_assist window does not populate back to the code inserted.
Actually, further testing shows that this field can't handle quotation marks, that's all.
Comment #10
simon rawson commentedContinuing this little conversation with myself, there were a couple of syntax errors in your patch which were causing all of these problems, and the use of a curious form attribute "#extras"... which is a new one on me! I switched it for "#attributes".
There may be more bugs I have not yet found.
Comment #11
grohk commentedHello Simon,
I tried to apply your patch to revision 1.54 of the module and this is what happened:
Any ideas?
Comment #12
simon rawson commentedProbably that I am evil and created it on Windows, so it will have windows line endings on it :-(
See http://drupal.org/node/324.
I should really learn how to do that myself - very antisocial, I know.
Comment #13
alanburke commentedNot so much a bug report as I havent tested this.
Is is meant to work with 4.6?
Some feature request for new version.. seems like this would be best place to ask.
Anyway,
Waldemar mentioned that he would like to integrate this with Gallery 2.. That would be brilliant.
Similarly, could the new version integrate with Acidfree from the start?
Acidfree has some advantages in that it is closely integrated with Drupal, and stores images as a node [allowing tagging etc], but Gallery is more fully featured.
Lastly,
When using Img_assist to add images, could the option be there to add them to the preferred image module, whether it be Acidfree, Gallery or plain old image.
Thanks for the module, When I started using Drupal, I couldn't believe this wan't a core feature!
I now realise the value of modularity!
Regards
Alan
Comment #14
simon rawson commentedSorry, Alan, this isn't going to answer any of those questions - I hope someone more knowledgable than I will be able to help you.
Instead here is (I think!) a unix friendly patch to apply to 1.54 of img_assist to make it work with 4.7.
I should say that I have already discovered further bugs - you can't actually upload a new image via img_assist at the moment.
Simon
Comment #15
simon rawson commentedI've basically solved all the outstanding bugs with this, except one.
When I use img_assist in conjunction with tinyMCE and insert HTML code from the img_assist window into the tinyMCE textarea the link which is sent with the image contains "../../../../../" before the actual like to the image node (node/xx). This doesn't happen when you are not using tinyMCE (i.e. you are plain-text editting). Which leads me to think that it must be an tinyMCE problem?
I would appreciate any input on this, because I don't think I can solve it myself. tinyMCE is too complicated for me!
Any suggestions?
If I solve this then I'll post the complete patch for 1.54 to make it 4.7 compliant.
Comment #16
Waldemar commentedHey Simon!
Thanks for fixing things, I am very busy at the moment and don't get to do anything. Those ../../... you mentioned probably come from my patch for drupalimage, as you have to provide a relative path there. It is hence definitely coming from drupalimage. I might have time later today to look at it and would greatly appreciate if you could post the fixed version, so that we don't get mixed up in different codes.
Thanks!
Waldemar
Comment #17
Waldemar commentedAlan,
in case it is of any interest, I did convert the MichelleC's g2_filter module for 4.7, you can get it at the "issues" page of the gallery module. With it you can add images from G2 to your nodes by inserting [G2:ItemID] Tags. That is not a full integration, I know, but it's better than nothing. I am definitely not going to touch Acidfree, as G2 is a far better gallery IMO and that's the one I will be using, sorry. I plan, however, if I have time, to implement a better G2 integration.
Waldemar
Comment #18
simon rawson commentedWaldemar,
I've attached a new patch which brings everything up to date. I've also put in a workaround for the bug I just posted about (the relative link in tinyMCE). It's on line 902. I've included the absolute url instead. tinyMCE still appears to cut some bits off with a ../ or two, but the url is now long enough that it works in every case that I've tried. (Like, I said, I don't even claim to understand tinyMCE!).
The only other outstanding issue that I have is the setting entitled:
"Hide 'inline image link' for the following node types:"
I can't work out what this is supposed to do. I've fixed up the form so that it works in 4.7, but I can't see that setting implemented anywhere within the module! Any ideas?
Simon
Comment #19
Waldemar commentedSimon,
It's working very well, thank you! I am not sure if that is what you mean, but I experience the issue, that the image is inserted correctly, but when you move it around in tinymce for some reason ../../ gets appended to the image path. It has to be a TinyMCE issue and I am surprised by it. I'm flying to Germany today and will try to debug during the flight :) I don't think it has to do anything with TinyMCE though.
Waldemar
Comment #20
simon rawson commentedThat's exactly what I mean. Good luck trying to debug that one!
Comment #21
Waldemar commentedI seem to have been extremely tired when I have written the last statement :) I mean of course that it IS a TinyMCE bug, not an img_assist one. Sorry. I have not come around to debugging yet. Can somebody check if that problem exists in Drupal 4.6?
Comment #22
jwilde commented..."the image is inserted correctly, but when you move it around in tinymce for some reason ../../ gets appended to the image path."
The same thing happens in 4.6 when I use tables and images.
jim
Comment #23
phildu commentedi use diff npatch on a macsox and , he reject a lot of code
i use the img_assist.module_3.patch and the img_assist.module,v 1.54 2005/11/30 02:48:56
why ??
Comment #24
Waldemar commentedJim,
thanks for the info, that's helpful. Simon, it hence is a TinyMCE Problem I guess. Not sure if we should go on fixing, if we have to patch TinyMCE for that. But might be worth finding out what actually causes it. I'll post if I find out anything.
I actually had a patch rejection as well, don't remember what exactly the problem was, I think I took out one of the first lines after which it applied fine.
Waldemar
Comment #25
simon rawson commentedI apologise if there are any problems with the patch. Unfortunately I have to produce them on a windows system and then try to convert them to unix file formats. So it's highly likely that there may be some problems! Not a lot I can do... :-/ Sorry.
Comment #26
monyo commentedI have a few questions about this patch.
Before anything else we do know that there is a problem with running the patch. I wish someone will attach the module itself so that we can try it.
1. With this patch, will this enable the camera icon that appears below the texarea like in the 4.6.0 version? I could not get the icon to show up.
2. I applied the 3 patches manually and was able to get the img_assist plugin for tinyMCE to popup including all the image files. I was able to select the image to show in the preview pane having all the image properties displayed at the bottom portion of the popup window, however, clicking the insert button does nothing for me.
3. again, i wish someone who got this patch going create a working patch and post it here so we can try it.
Comment #27
simon rawson commentedI'll try to answer the points you raise.
Firstly, there are no known problems in applying these two patches:
properties.js.patch (970 bytes)
editor_plugin_src.js.patch (827 bytes)
The most significant patch is the one for the img_assist.module itself. I created the patch, it appears to have some problems - not with the code, rather with the format of the patch. I'm sorry that I can't help any further with that.
What I can say is that, with these patches applied, I have a fully working version of img_assist with the tinymce plugin working properly.
Comment #28
peterjohnhartman commentedAttached is an img_assist.module_3.patch that works on something less selfish than Windows. It is the exact same patch as simon's, only made to work.
I also suspect, though I haven't investigated this, that it trumps phpcoder's (and my own) later patch at http://drupal.org/node/42553.
Comment #29
Bèr Kessels commentedComment #30
phildu commentedi have always this error whit this patch
i dont know why ?
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home2/c/cx-rousse/www/drupal47/modules/img_assist/img_assist.module on line 372
i use diffnpatch on osx
someone could send the complete module ??
Comment #31
Jaza commentedThis new patch makes the image directory work properly, whether it's configured to display as a list of all images, or to display a filtered list of images based on taxonomy (also works for 'my images'). It also rolls the img_assist.module patch and the properties.js patch together in one file.
The only thing I can see that still doesn't work properly is the 'image preview filter' select list on the img_assist settings page. This setting is used properly if set manually in the database; but it doesn't seem to get saved properly through the admin interface. Maybe a forms API multi-select problem, or a system.module problem?
Comment #32
Jaza commentedDiff between img_assist.module with the previous version of the patch applied, and with the new version of the patch applied (so it's clear what new changes I've put in).
Comment #33
Jaza commentedChanged an array2object() call to a cast using (object).
Comment #34
phildu commentedi cant apply this f.. patch
is it because i'm on a mac ??
strange , because it's not my first one.
could you send me the complete.
Comment #35
kvarnelis commentedis there anyone who can host this thing for us or can we put this into cvs? i have a mac and i don't really feel like duplicating all these problems that people have had! patching is so much harder than just downloading a module, i'm not sure why we bother to do it, actually...
Comment #36
kvarnelis commentedto clarify: i just gave it a try and wasted my time. these patchs aren't going to work on macs. but it's not like we're on a 12k baud modem! let's get the module. many thanks!
Comment #37
phildu commentedi'm agree whith kvanerlis
Comment #38
grohk commentedGreetings, I just applied the most current patch from Jaza called img_assist_formsapi_5.patch without any problems on my Mac OSX 10.4.4 machine.
What errors are you seeing? The maintainer of this module probably is not going to apply these patches to his module unless they can be thoroughly vetted by the community. That is what patches are for.
Comment #39
phildu commentedin fact i use the software"diffanpatch" and it always make me errors
Comment #40
grohk commentedPardon my further questioning, but Mac OSX ships with GNU versions of the diff and patch utilities, and the way these patches are formed is valid. In order to facilitate your issue, we are going to need more detailed information.
Comment #41
Visigotik commentedAfter aplying the pacthes I had to coment out two lines on tinymce.module (lines 71 and 72) to make to make it work:
to
Thanks.
Comment #42
Visigotik commentedAnd the patched files for the people that can't patch them (the previous upload didn't seem to work)...
Comment #43
veelo commentedNote that img_assist has a new maintainer now, who has rewritten the module completely. His code should appear in CVS real soon now. Check it out in this post.
Bastiaan.
Comment #44
bryan kennedy commentedThe img_assist_formsapi_5.patch when applied to the CVS version of the img_assist.module worked great for me in drupal.4.7 beta4. If the new version of img_assist that is being re-writen is in the works, I would like to see this current version continue since it is tested and works now with 4.7. Add my vote to commit this patch to CVS and then to 4.7 contrib modules.
Comment #45
quiptime commented@bryan kennedy,
please send me the complete code of your img_assist.modules (worked great for me in drupal.4.7 beta4) or attaches the file.
With my img_assist.module (same patch version) i can't save changes in settings -> Preview settings -> Image preview filter.
I would like to find even the error in the code.
Thanks
quiptime
Comment #46
benshell commentedI've just committed my new rewritten version of img_assist to the CVS repository. Hopefully it will work great for everyone (and if it doesn't please submit a bug report or feature request).
Comment #47
benshell commented