Moved from #451470: Page refresh after upload removes existing values from CCK fields
I don't know if it's related or not, but I have jifupload working perfectly on one website, but it won't work on another. I updated filefield & imagefield, (latest as of may 7th) and after I upload the images, the page refreshes, erases the title and body, then tells me that the alias is already in use and changes my title to "temporary title - replace this title" or something to that affect. I'm sure it has something to do with pathauto as well, but I also noticed that uploading images with a tokenized path, (filefield path is not enabled), the tokenized path is not recognized... jifupload would either upload to the folder before the token path or create a new folder with the token naming convention, instead of the actual tokenized path. (Example: /images/[site-date-yyyy] should be 2009, instead it outputs /images/site-date-yyyy) I dunno if it has to do with filefield or jifupload at this point... Regardless, It appears that with the updates made to either filefield or imageupload, jifupload is not quite working right...
Comments
Comment #1
awolfey commentedI've found the bad logic in the module checking for tokens. I will get to it soon. For now if you enable filefield_paths all of your tokens will work. I hope to get to it early next week.
Aaron
Comment #2
awolfey commentedI've just committed a fix to the token problem here. I see you're using the dev or patched version of token #236596: Add support for date parts YYYY, MM, and DD. I tested that it it now works.
I am unable to duplicate this, however:
Can you give me some more information if that is still happening? What are the differences between your 2 sites that you suspect might be related?
Thanks.
Comment #3
philsward commentedWell, I did a "little" bit of digging tonight to try to figure out the "Temporary title - please replace." problem, and still haven't come up with anything... I updated to all of the necessary latest modules as of today (2009/05/17) (ie filefield, imagefield, pathauto, token, cck) but i am STILL getting the temporary title problem...
After looking at the other site that is working properly, I have the following module versions installed, related to the gallery:
Content Construction Kit (CCK) 6.x-2.x-dev (2009-Mar-23)
Date 6.x-2.x-dev (2009-Mar-23)
FileField 6.x-3.x-dev (2009-Apr-04)
ImageAPI 6.x-1.5
ImageCache 6.x-2.0-beta8
ImageField 6.x-3.x-dev (2009-Apr-01)
jUpload for Imagefield 6.x-1.x-dev (2009-Mar-29)
Pathauto 6.x-2.x-dev (2009-Mar-30)
Token 6.x-1.x-dev (2009-Mar-27)
I haven't had a chance to try to replicate the problem yet, but at-least I have something to bounce from... If I figure anything out, I'll try to remember to post it on here.
Comment #4
awolfey commentedjifupload sets "Temporary title - please replace." as the node title when the title is blank when you upload images. jifupload does a couple of node saves, and if there is no title, it make it harder for the user to find the node, edit it, etc. (The node form validation is bypassed, so drupal doesn't check for the title, which is normally required.)
I wonder if you have any other modules in place that deal with the node title? Perhaps there is a conflict there.
I don't believe any of the required modules affect the title. pathauto probably reads the title, but I think that's it.
Let me know if you figure it out.
Thanks.
Comment #5
philsward commentedI have been pulling my hair out trying to replicate the problem. I misinformed about the "other site is working" I did some digging and found that it too, is not working...
What I have come up with though, is with pathauto. If Do nothing. Leave the old alias intact. is set, then path auto will not generate an alias once jifupload initially saves the node. Then, when I do an actual save of the node, it doesn't update because the node has already been created. Now, when jifupload does it's initial save, I get the error:
Ignoring alias gallery due to existing path conflict.Let me note that I always put something in the Title and it doesn't seem to matter, it still comes back with the the "temporary...." error.I have a view setup with the root path of:
http://sandbox/galleryand I have a feeling that when jifupload does it's save, it isn't working well with pathauto.I'll explain how I have the site(s) setup and maybe it will clue you in a bit.
Primary "Gallery" Modules Used:
Date
FileField
ImageField
JifUpload
ImageCache
ImageAPI
Pathauto
Token
I have created a new content type: Gallery
CCK Image: "Image" -> filefield_image -> File -> Image
- Max resolution: 1024x1024
- Path: images/gallery/[site-date-yyyy] (tokens seems to be working in updated jifupload version btw...)
- Not required
- Unlimited Images
- (Rest of settings are pretty much default)
CCK Date: "Date" -> filefield_date -> Date -> Select List
- Default value: Blank
- Custom input format: FY
- Required: Yes
- Granularity: Year & Month
- (Rest of settings are pretty much default)
Pathauto:
- Update action: Do nothing. Leave the old alias intact.
- Node Settings Alias: gallery/[field_date-yyyy]/[field_date-mon]/[title-raw]
- Transliterate prior to creating alias: Yes
- (Rest of settings are pretty much default)
ImageCache (Just setup with a generic thumbnail with a scale & crop of 125)
ImageAPI (ImageMagick)
Views:
New view type: gallery
- Default Fields: Content: Image
- Default Filter: Node Type -> Gallery
- New Page called "Gallery"
- Path: gallery
- Menu: "Gallery"
The reason I am using the "date" module, is for two reasons, one to show the end-user the general date of the gallery (month and year granularity is good enough) and the second reason is to create a path alias based on the date of the gallery.
The main things to note with the alias problem are probably:
1) Pathauto alias: gallery/[field_date-yyyy]/[field_date-mon]/[title-raw]
2) Views gallery path location: gallery
I still can't figure out what is different between my two sites that are getting the "Temporary title - please replace." issue and my sandbox that isn't, but I will note that all three are having issues with the alias|pathauto thing.
It's late and I don't feel like messing with it any more (been at it for a couple of hrs) Let me know what you think :)
Comment #6
awolfey commentedI'm going to try to work on this today, but here is my initial guess.
You start adding a node, set your title and date.
You upload some images.
Jifupload does not process your date fields, so pathauto tries to set the path as /gallery, leaving off the date tokens because those fields are empty.
This creates a path conflict with your view.
I think I may see the other problem also.
The big issue for the module is how to deal with cck fields.
Comment #7
philsward commentedI think you hit the nail on the head :) I know that you are working on the cck fields not sticking issue, so I will be patient. It looks like my problem is most likely, directly related.
Thx for your work on this!
Comment #8
awolfey commentedI've just committed some improvements to pathauto support. Please test and let me know if this solves your issues. Get it from cvs or wait for drupal to repackage later today.
Note that jifupload still does not process other cck fields, so if you are using field tokens in your pathauto settings, they will only work when you save the page. But for your case, where you are keeping the original path alias and not allowing updates, you will have to save the page first before you upload your images.
I'll update here if/when I get cck support working.
Let me know what you see. Thanks.