When uploading new images and adding new image nodes using img_assist, vocabularies whose terms the current user may not associate nodes with are being displayed. These vocabs do not display when adding images thru node/add/image, as it should be per the TA rules.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | tac.img_assist.patch | 639 bytes | grendzy |
Comments
Comment #1
solipsist commentedThis is quite a serious problem yet no one's been assigned or even commented. Amazing...
Comment #2
benshell commentedSubmit a patch. I only work on img_assist when I have time (it's a hobby, not a job).
Comment #3
solipsist commentedOkay, I'll do that. Just wanted to make sure you were aware of it. I know you rewrote it from scratch so I thought you might have an idea why it happens, since I don't and haven't had time to investigate. Thanks for your work, it's perfect except for this tiny detail. :)
Comment #4
benshell commentedExcellent, thanks. I not exactly sure why that's happening, but I suspect it's because I used a custom query to build the list of terms, rather than using an existing taxonomy module function. To fix this I think you'd have to either modify this query or possibly rewrite a few lines of code to make it use an existing taxonomy function.
I'm sorry I haven't been working on img_assist lately. I have so many ideas to make it better, but so little time.
Comment #5
jferjan commentedThis bug is driving me crazy and i have not nearly enough php knowledge to solve it by myself. I tried commenting out different parts of img_assist module code but did not find "custom query to build the list of terms". Any help will be appreciated.
Comment #6
darren ohThe custom query to build the list of terms has always been commented out (lines 727-732 of img_assist.module). The problem is that img_assist sets its access settings independently, using the vocabularies specified on the settings page (see function get_image_vocabs).
Comment #7
jferjan commentedI just found out that categories get listed acording to Taxonomy Access create or list permissions.
when adding images thru node/add/image:
categories get listed acording to TA create permission as it should be
when adding images thru image_assist:
categories get listed acording to TA list permission (instead of create permission)
i cannot find this bug ....alll i see is that img_assist just calls node_add function
Comment #8
darren ohImg_assist uses the default node add form. get_image_vocabs is not related to the image upload form.
Comment #9
darren ohJaka, could you check the output of node_add('image')? I don't use taxonomy access, so can't test. Put the following lines into the body of a story node and set the input format to PHP:
Click preview and see if the correct categories are listed on the resulting form. (The output will be a bit confusing because you're previewing a node add form in a node add form.)
Comment #10
grendzy commentedI just noticed this bug, then found this issue page. I tried the test of
node_add('image')suggested here. The story displays all of the categories, including the ones disallowed by taxonomy_access module.I'm a total drupal & php novice, but I'll do what I can to help squash this bug.
Comment #11
grendzy commentedI'm still trying to figure this one out. Can anyone recommend a php debugger? I've tried to get Eclipse PDT with the Zend debugger running, but so far it's not working. I can run the project, but it won't stop at breakpoints. I'm using OS X 10.4.
Comment #12
grendzy commentedGood news. I gave up (for now) on Eclipse and the Zend debugger, and tried a demo of Komodo. I found the problem. In taxonomy_access.module:
As you can see the decision on whether to use "create" or "list" permissions is made based on the url. It's expecting to find /node/add or node/xxx/edit. img_assist is at /img_assist/upload, which tac doesn't recognize, so it defaults to "list" permissions.
I can think of a couple of options:
if (arg(0) == 'img_assist' && arg(1) == 'upload') { $op = 'create'; }Yuck!
Ideas? Thanks!
p.s. – jferjan, how did you post the php code with the syntax coloring?
Comment #13
grendzy commentedHere's a patch the implements option 3 from my previous post. The patch applies to taxonomy_access. This is almost certainly the wrong solution, but it does work, so I'm posting it for the benefit of anyone who wants a quick workaround.
I did try tweaking hook_menu first, setting the paths to node/add/img_assist/[OP], but my first crack at it produced really goofy results. I think this could work, though, I noticed that image_import.module works this way. I'm afraid at present that I don't know enough enough drupal internals to figure this out, so if someone else can pick this up it'd be greatly appreciated.
Does anyone know if this issue exists for Drupal 5 as well?
thanks,
Dylan
Comment #14
sunSupport for 4.7 is discontinued.
Please upgrade to Drupal 5 and latest Image and Image Assist versions.
Feel free to re-open this bug for 5.x, if you still encounter this bug.