Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am trying to create simple photogallery using CCK and Imagefield. When I added new node, uploading went as expected. But when I try to add images to existing node (same imagefield), I get following error:
The path is already in use. All queued images were deleted.
It doesn't matter, how much images I try to upload. I also tried to upload via standard widget and this works as expected.
Please let me know, if you need more info or if this error isn't related to Image Fupload. Thanks in advance,
Miloš
Comment | File | Size | Author |
---|---|---|---|
#26 | image_fupload_imagefield.module.patch | 1.53 KB | ELC |
#16 | image_fupload_imagefield.module.patch | 1.35 KB | lysander19 |
Comments
Comment #1
Queeq CreditAttribution: Queeq commentedHaving exactly the same problem. Any suggestions?
Comment #2
djsmith CreditAttribution: djsmith commentedHere's a hint: I was having exactly the same behavior. Initial FUploads on a new node with a CCK ImageField worked fine, but failed on subsequent edits. Worse, it was working on one site in my multi-site installation, but not on another.
After several hours comparing settings between sites, (in a fit of desperation) I changed from the Sky theme (/project/sky) to Garland and it started working. I tried several other themes I had installed: Acquia Slate, CTI Flex, Zero Point and they all worked. It only fails on an edit when I use Sky.
It doesn't occur to me how a theme interacts with these modules to cause this behavior, but perhaps this will give someone with better understanding a clue to resolve it.
If it's relevant, here are the versions I have installed:
Sky 6.x-3.9
FileField 6.x-3.1
ImageAPI 6.x-1.6
Image FUpload 6.x-3.0-rc2
ImageField 6.x-3.1
ImageCache 6.x-2.0-beta10
Content Construction Kit (CCK) 6.x-2.5
Comment #3
ricmel111 CreditAttribution: ricmel111 commentedHaving same problem
Comment #4
sokru CreditAttribution: sokru commentedExactly the same problem.
Comment #5
vedeem CreditAttribution: vedeem commentedSame problem here
But with the aquia slate theme
Tried to switch to Garland but no succes
Comment #6
grandcat CreditAttribution: grandcat commentedThe error message says that somewhere in cck, a wrong path was set. Please check this. This should not be the problem of the theme.
Comment #7
pacome CreditAttribution: pacome commentedsame problem for me..
Also it uploads some images, but not all of them, like the first 3 images, and got stuck after it with the message "validation error, please contact site administrator"....
any advice ?
-P-
Comment #8
Breakerandi CreditAttribution: Breakerandi commentedExactly the same problem, fupload doesn't work with the error message from post#1, alternative normal imagefield works..
Comment #9
MichelleI'm having the same problem. It looks like it's ok for the first 3 and then it goes and deletes everything. I tried ensuring the path was already created in case having to create it was confusing it. All I can think of is that it's tripping up on the token? The image path is images/user/[uid]/blogs with [uid] being a token.
Michelle
Comment #10
eeyorrSame problem here. I created several new nodes with no problem and then, all of a sudden, I got this error upon creating new content and editing existing content.
Comment #11
grandcat CreditAttribution: grandcat commentedYou have to remove the Cache minimal lifetime. Then it works. (workaround at the moment).
Comment #12
eeyorrI have this problem when caching is disabled.
Comment #13
grandcat CreditAttribution: grandcat commentedTry enabling "Normal cache" and set minimal lifetime to "".
Comment #14
milos.kroulik CreditAttribution: milos.kroulik commented[#13] Workarounds by grandcat don't work for me. Reverting to critical. Perhaps we should set up bounty for solving this bug? I would contribute 10$.
Comment #15
Daniel Wentsch CreditAttribution: Daniel Wentsch commentedI'm experiencing the same issue. No matter if cache is enabled or not. Also switching from my custom theme to Garland didn't improve things :/
Comment #16
lysander19 CreditAttribution: lysander19 commentedI think unsetting node_id generates the problem.
I made a little patch, works for me, check it.
(i am absolute newbie, tell me if patch format is wrong or something)
Comment #17
Daniel Wentsch CreditAttribution: Daniel Wentsch commentedHey lysander19,
thanks for your help.
I had no luck applying your patch but I'm not 100% sure weather it's the patch or my new system. I've been successful running patch on Windows XP previously but this is the first time I'm using it on Windows 7. Here the output:
What does the exclamation mark mean anyway? Up until now I've only seen ++ and -- to indicate lines being added or removed. Now I'm confused how to apply the patch manually :/
PS: also had no luck patching in Eclipse.
Comment #18
grandcat CreditAttribution: grandcat commentedNo. This was implemented purposely.
Comment #19
p4trizio CreditAttribution: p4trizio commentedSame stuf, tried with cache life time, nothing happened.
Comment #20
ELC CreditAttribution: ELC commentedPerhaps, but it seems to be the only way to get around the problem. I have been unable to locate any bugs introduced by deleting the following line from image_fupload_imagefield/image_fupload_imagefield.module, however I'm sure my situation is not the same as everyone else.
The error only occured when I was using the path module and the already created node I was editing had the path set to something.
I tracked the error The path is already in use. down to the path/path.module file.
By removing the nid from the $form & $form_state, when the drupal_process_form call occurs, drupal attempts to create a brand new node each time instead of adding it to an existing node.
Perhaps editing a node and creating a new one should be split up to prevent whatever bug is caused by leaving the nid set. I'm at a loss to come up with anything better without knowing what that bug is.
Comment #21
milos.kroulik CreditAttribution: milos.kroulik commentedThis is certainly not the right solution. When I comment that line, I get:
This content has been modified by another user, changes cannot be saved.
It is not surprising, given following comment directly in code:
if we are editing already existing node, remove nid to prevent errors because node was changed before
So it really seems it was introduced purposedly and it's not a bug.
Comment #22
ELC CreditAttribution: ELC commentedI only get that error if I edit the node with any other kind of callback before uploading an image, but I have only had this error once. I also cannot use the module at all without commenting this out. Well, I can half use it. I can create a new node without issue, but I can just never add any images to it later when editing.
I may need to add that I have modified the module to use SWFUpload 2.5.2 and image resizing on the client side. I have no idea if there are changes in SWFUpload.swf that may be contributing to this. I've only changed javascript to enable this. I had intended to clean up my work and submit a patch, but it does involve cutting this line out.
Tracking down that exact error message results in this chunk from node_validate()
While finding out the cause is within my grasp - I have no idea how to fix this sorry. Perhaps the posted node data could be updated to the node_last_changed($node->nid) before attempting to save it, but this is essentially a hack and bypassed this protection, but so is removing the nid from posted node data.
I can't have the line in the module, you have to have it. There must be a better away around this problem.
Comment #23
ELC CreditAttribution: ELC commentedI just had a look at the patch provided again and it already includes code to avoid the error message you describe in the exact way I described to do it. Did you fully patch your code?
Based on the code in node_validate() this above patch should probably be changed to this instead.
Comment #24
milos.kroulik CreditAttribution: milos.kroulik commentedThis seems to be patch file in context format. As such, it seems, that first ! is for original line, the second for changed.
Comment #25
milos.kroulik CreditAttribution: milos.kroulik commentedThanks, it seems to be working, but I have to test it properly.
Comment #26
ELC CreditAttribution: ELC commentedHere's the updated patch .. same format but I knocked out any ! type lines by not editing single lines ;) With only the 2 lines difference between the patches plus a few comments, it hardly seems worth it though :P
Comment #27
greenbeans CreditAttribution: greenbeans commentedThanks for the patch in #26. I'm getting the same error again on the "next step" (Edit Captions) screen, though. Any ideas?
Comment #28
ELC CreditAttribution: ELC commentedThe
path is already in use
message<, or theThis content has been modified by another user, changes cannot be saved.
one. If you're getting the second one, I'm guessing there's another instance of the node modification time not being updated again. Alas, I've now got this in production on the sites so I can't fiddle with it there. If I get a spare moment I'll have to hunt through the code looking for similar situations.Comment #29
arski CreditAttribution: arski commentedJust tried the patch - it seems that unsetting the nid forces the "modified by another user" error, but setting the node->changed value actually solves the issue.
Comment #30
leobaby CreditAttribution: leobaby commentedI am experiencing this same problem and have tried everything listed in this thread. I have a content type with imagefield and taxonomy field. I am editing existing nodes. I have caching set normal with for minimum lifetime. I get the path is in use error and tried applying the patches (to 6.x-3.x-dev and rc2).
One thing I did notice is that before I get the error message "This content has been modified by another user..." another error briefly flashes in the same spot. I snagged a screenshot of it because it happens so quick
warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/leobaby/public_html/modules/image_fupload/image_fupload_imagefield/image_fupload_imagefield.module on line 392.
Since I applied the patches manually, line 392 for me is ...
$node->$field_name = array_merge($node->$field_name, $imagefield_files);
I would really appreciate a solution to this problem and will contribute $10 to the bounty if it's soon, $20 if it's tomorrow. I have 200+ nodes to edit with over 800 images.
Comment #31
MafiaMoe CreditAttribution: MafiaMoe commentedI am getting the same issue when used with a Project type:
"This project name is already in use.
This project name is already in use."
This feature did work just fine when used with a Page type, but now I get other errors when uploading to Page and Event types (although the images do upload). I too need to upload hundreds of images now, and likely hundreds more over the coming months. I am willing to put down some bounty money simply for the time this would save me.
Comment #32
Train CreditAttribution: Train commentedI wanted to give some input because this issue was also plaguing me...
Using 6.x-3.0-rc2.
I had an existing node that would generate "The path is already in use" when trying to FUpload images. Other nodes of the same type would work fine, just not this one.
The problematic node had "Automatic alias" for URL path settings unchecked and had a manual entry for the alias. I couldn't check the "Automatic alias" and get it to stick, it remained unchecked after saving the node and kept the manual entry.
Went to Site building -> URL aliases and deleted the manual entry, went back to the node, checked "Automatic alias", saved the node and let it automatically generate a new alias.
After that, no problems, works a charm.
Comment #33
AdrianB CreditAttribution: AdrianB commentedSubscribing.
Comment #34
UpTil4Music CreditAttribution: UpTil4Music commentedHaving the same problem til I checked "Automatic alias." Seems to correct the problem. Not really a solution, though.
Still getting "This content has been modified by another user, changes cannot be saved" occasionally, but the changes are there when I go to 'view.' Doesn't automatically return to 'view.'
Comment #35
jamoralesr CreditAttribution: jamoralesr commentedThe problem is in the path auto, if you change it manual this generate the issue. I changed to auto path of the node and the problem is resolved. When I finished to upload I changed to manual path and all its ok.
Comment #36
greenbeans CreditAttribution: greenbeans commentedThe pathauto workaround is not an acceptable solution if you expect the people who are uploading images to be end-users.
Comment #37
kassissieh CreditAttribution: kassissieh commentedSame experience as above:
- The path conflict refers to the page URL alias
- Applying the above patch causes the "another user is editing this page" error
- Changing the page URL when saving avoids the problem, but this is not an acceptable workaround.
(subscribing and thank you for your work on this)
Comment #38
wadmiraal CreditAttribution: wadmiraal commentedsubscribing
I confirm that it has something to do with the path module (and not necessarily path auto). As long as the url remains of "node/xxx" everything's fine. As soon as a custom path is entered (via pathauto or manually without pathauto installed) it triggers this error on editing.
How do you save the revision ? How do you target the particular node ? It has something to do with the node url, as if it tries to duplicate the url in the
url_alias
table.Comment #39
wadmiraal CreditAttribution: wadmiraal commentedIt's this line that causes the "error":
path.module
, line 143Comes from
image_fupload_imagefield.module
, line 283Comment #40
wadmiraal CreditAttribution: wadmiraal commentedThis is a dodgy way to fix this, but:
Problem:
When editing a node that already has a path alias, the form is submitted with the path (
$form_state['values']['path']
). This creates a conflict with the path.module, which enforces all urls to be unique (duh) and thus sets a form error:"The path is already in use."
.Solution:
The textfield for the path alias should be empty when uploading new images to an existing nodes. As the module depends on javascript, we could add
$('#startuploadbutton').click(function() { $('#edit-path').val('')});
to thewindow.onload
function inswfupload-settings.tpl.php
.This will clear the field on each edit. When clicking "Next Step" after uploading, the node is saved using the previously declared path ! So, even though we unset the field, the url remains.
Important note !
The image_fupload_imagefield.module does not allow users to change the path ! Even when users change the url and upload new images, the new url is not taken into account ! This is, however, another problem and not part of this issue. When it will be addressed, this
The path is already in use
problem will be solved as well.Comment #41
Haarht CreditAttribution: Haarht commentedSame issue when editing existing nodes. Checking "Automatic alias" helps, but I don't want to change already generated aliases.
Comment #42
babbage CreditAttribution: babbage commentedFor what it is worth, I was also encountering this error. I had the URL Alias section of the edit form turned off, so it was not displaying on the edit page (I'd done this with the Display Suite module I think.) With the URL Alias section turned off, I'd see this error. When I turned it back on so it was present in the form, the error disappeared. This could be reliably reproduced. Not sure which side the error was on; I've just hidden the unwanted section using CSS for those users with permissions to edit this and have moved on, since it was a visual design rather than security issue in this case....
Comment #43
sydneyshan CreditAttribution: sydneyshan commentedSetting the Minimum cache lifetime setting to NONE fixed this for me, however this is not a desirable setting when running a performance-optimized website...
Comment #44
joshuautley CreditAttribution: joshuautley commentedFor issues related to content with more than one image: Try to delete the content that is giving your problems. Check that the set number of images is unlimited. Then create the content from scratch. This is how I solved this error on my end. I also deleted the files from tmp directory before re-creating the content.
Comment #45
killua99 CreditAttribution: killua99 commentedI did the same as #44 but when I try to edit the node I get the same error. This is not fixed yet? 2 years later?
Comment #46
gertieiv CreditAttribution: gertieiv commented#44 did it for me ... for a while,
same problem again
Comment #47
strands CreditAttribution: strands commentedMaking sure Automatic alias was checked solved it for me.
I would usually have this checked on anyway.