Closed (fixed)
Project:
Classified Ads
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Sep 2011 at 18:30 UTC
Updated:
9 Jan 2012 at 15:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
fgmPlease describe the steps you take to obtain this problem: it does not happen on any fresh install I have (just tried again on a fresh D7).
It really looks like this is not a fresh Drupal 7 install, but one that already have a previous ed_classified install on it.
Comment #2
fgmForgot to set status. This should only happen when editing nodes dating from an older version, which is not supported.
To make sure of the situation, look for tables edi_classified_nodes (should not be there) and classified_node (should be there).
Every node in {node} should have a matching entry in {classified_node} and vice-versa. Is this the case on your site ?
Comment #3
clauded commentedThis is a D7 installation not upgraded from D6.
I've check the tables and they are ok (no edi_classified_nodes, classified_node is present, entries in the DB looks fine). The only 'tweak' I made is to rename the taxonomy terms 'For sale' and 'Wanted'.
Saving thads is ok. The display of ads is OK. It just those annoying messages displayed when Ad is saved.
Can you elaborate on what the error message could mean?
Comment #4
fgmThis message means that the module is trying to access the posted values for these fields because the form is being submitted (there's a test just above this to make sure this is a submission), but they are not present in the form_state, although they have been injected from the form when it was editing.
This could possibly happen if some module is doing a form_alter and removing these fields, but I do not see why one would want to do that. Does this happen with only core and classified, no extra module installed ?
Comment #5
fgmFWIW you can try applying this patch, which might /hide/ the problem, although it is not really a solution itself: even if the problem disappears with it, we are still left with trying to understand why it happens on your install and not on any other I have.
Comment #6
clauded commentedThe patch works.
This probably happens because I added a picture field to the Ad content type : the error message was displayed after uploading a picture.
Comment #7
clauded commentedI wonder if it's the patch (it used to work) but the number of ads in the /classified view is not updated beyond the first ad :
0 ad : 0 is displayed
1 ad : 1 is displayed
2 or more ads : 1 is displayed
Comment #8
fgmCannot reproduce the problem either: the number of ads is displayed correctly with or without the patch.
Can you reproduce it on a default, english, core install with just core and classified ?
Comment #9
clauded commentedOk I tried without the patch and I have the same problem. I'll do more testing and probably open another ticket for the numbering issue.
So the patch looks fine when adding image content type. Will the patch make it to the final release?
Comment #10
fgmThe patch, in this form, will not make it to the final release: as I wrote, it hides the problem (the symptom), but until we know how you manage to produce the problem, it is worse than doing nothing, because it can let think that there is no underlying problem although there really is one, which I was never able to reproduce.
At this point, it seems you are the only one able to help, by providing a reproducible way of causing the problem, starting from scratch at core install, at which point I will be able to find how to actually solve it instead of just masking its symptoms. It is probably telling that the other issue you mention is also not reproducible on any of the machines on which this is tested before release: both are probably related.
Comment #11
clauded commentedAs I mentioned in #6, this happens when I add a picture field and upload an image : then, before saving the ad I get the error. It's reasonable to think that many users of the module will want to have pictures in their ads.
Edit. The numbering problem is also related to adding images filed : I will not see the problem until I add an Ad with a picture.
Comment #12
fgmCan you explain how you add that picture ? Is it an imagefield ? A media reference to a media image ? An image-type attachment ?
Comment #13
clauded commentedIt's an image field.
Comment #14
dougsap commentedThank you for this patch! I had a similar problem on 7.x-3.0-rc1, where I had added three images to the Classified Ad content type.
When hitting the upload button (no error if just saving the ad with the files specified via browsing without hitting upload), I received:
Notice: Undefined index: expire_date in classified_form() (line 918 of /home/xyz/public_html/dev/sites/all/modules/ed_classified/classified.module).
Notice: Undefined index: expire_mode in classified_form() (line 919 of /home/xyz/public_html/dev/sites/all/modules/ed_classified/classified.module).
I upgraded to 7.x-3.x-dev, continued to get the same error, installed the patch and things seem to work great - no ugly error message. Thanks!
Comment #15
fgm@dougsap thanks for these details: the point which had not been made clear previously was the fact that it happened when using the "upload" button instead of just saving with the selected attachment, which is indeed something I never do. Now we might be able to see why this happens, and provide a /real/ patch: the current one only works around the problem without finding its source, which is why I did not want to commit it as such.
Comment #16
fgmComment #17
donwinchell commentedFirst thanks for this module. Second I also get this error version 7.8 drupal and 7.x-3.x-dev of classifieds.
I also added an image field and the error also only appears when clicking the upload button, but not when simply saving the page. Everything actually still works, i.e. the page is saved but as this is something that will typically be done by "a regular joe user" the error message is likely to be discouraging. Just letting you know that these two folks are not the only ones. (I have not tried the patch yet)
Comment #18
carnity commentedHi all.
I also have same error, deleted both buy and sale categories and this error started. Is there is any other final solution to cure the problem has been decided? Or should i patch it for now?
•Notice: Undefined index: expire_date in classified_form() (line 918 of /home/thehighb/public_html/carnity.com/carnity/sites/all/modules/ed_classified/classified.module).
•Notice: Undefined index: expire_mode in classified_form() (line 919 of /home/thehighb/public_html/carnity.com/carnity/sites/all/modules/ed_classified/classified.module).
Comment #19
carnity commentedAny update on real patch......!
Still waiting. Thanks in advance.
Comment #20
fgmThis patch should really fix the problem, not just hide it; the issue happens because the "upload" (and "remove") buttons /submit/ the whole form, instead of being just /buttons/.
Comment #21
fgmTest fails on qa.d.o., but succeeds on any other system both on D6 and D7. Usual qa.d.o., problem, ignored.
Committed to D7 and backported to D6.