Posted by mrweaver on December 18, 2008 at 5:38pm
| Project: | Recipe |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | jvandervort |
| Status: | closed (fixed) |
Issue Summary
Hi.
This module was working fine. It had been some time since anyone had added a recipe, but people have tried recently. The "yield" field is not saved, nor are the "instructions".
I am using the most recent version of the module.
mrweaver
Comments
#1
Hello?
#2
Hi,
Are you still on drupal 5.x? I have committed a fix to CVS HEAD, but can apply it to the 5.x branch too if you need it.
Sorry about the delay.
#3
Yep still on 5. Thanks
mrweaver
#4
I have upgraded to 6 and still, the yield field is not being saved. Others appear to have versions where the value is saved. Which versions work and which don't?
What's crazy is, when this module used to work, saving yields, etc., those old recipes work. Is there a conflict with a module or something, or some Drupal update since an early D5 version of the module that somehow changed?
#5
Yield in the recipe edit screen saves properly for me. Yield in the recipe summary box for on-the-fly calculations doesn't save.
Which one are you referring to? And how should it work?
#6
When I add a new recipe, or try to edit one, I enter the yield field, but the data is not saved. However, for the first recipes I entered, the yield field is saved. For earlier recipes, the yield number appears when I am looking at a node, and the double/halve buttons work just fine.
I have the latest version of the module. Should I completely uninstall the module, remove the tables, try reinstalling from scratch and then importing my old recipes into the database?
mrweaver
#7
Hi mrweaver,
Just to confirm, you are saying:
For old recipes where Yield was already known to have been saved correctly (meaning they have been viewed before), those recipes continue to display a Yield OK.
But... when you edit the recipe, the new yield does not save.
And, when you enter a brand new recipe now, Yield is also blank (even though you saved something)?
Let me know please so I can be sure what this is, thanks.
FYI-
I just tried editing, changing 5 to 6 on a Yield, it saves and displays fine. this was a recipe I created in the CVS-HEAD version under D6.
So I am not sure what is going on... but I suspect as you suspect, it could be something that only happened with upgrades.
You can try what you suggest, or you could fix this in the database directly if you have a way to edit the rows in Recipe (changing the value in recipe.yield). One of these methods will be easier for you than the other...
If you do upgrade, I would suggest doing a CVS pull against HEAD as that's what I can confirm is OK. (Perhaps this is also OK in 1.0-beta1, but I can not confirm that. )
The CVS code is development, but very stable as a new release is in the works and close to release.
#8
Editing the yield field for an old recipe (where the yield was saved) works.
Looking at a test recipe that I created, the "instructions" field has been wiped out (I may have seen that behavior before, it's been a while since I've looked at this module).
Just tried the development version, and editing old recipe doesn't work. However, entering new recipes saves the yield data and instructions, however I got two error messages, one each for the second and third ingredients:
I had entered: "1 pound bacon" and "1 pint sausage gravy." On account of these errors, the ingredients are not saved.
#9
Just tried the latest development release. The test recipe had 4 ingredients. It saved three and gave me this on the fouth:
Ingredients and yield were saved.
I have tried to go back and edit the old recipes but cannot get yield and instructions to save.
I looked in the recipe database and found that the nodes for these affected recipes do not appear in the recipe table.
The older recipes are there, and so are the couple of test recipes that I've entered since upgrading to D6. But those recipes where the yield/instructions aren't saved aren't there.
the nodes for these recipes are _not_ in the recipe_node_ingredient table, however.
#10
Committed fix for "Incorrect integer value" in 6.x-dev. We'll see if you can save again.
#11
Also, if you haven't, make sure to run update.php
#12
Cool. So I guess at some point this got checked in against some older branch but not against HEAD. Hope this is the only one like that. :-)
#13
I ran update.php and instructions and ingredients now get saved! Huzzah!
But I'm curious why older recipes still suffer the problem after the upgrade? I can't edit them.
#14
mrweaver,
Would you be able to do a database dump of your recipe tables?
I'm guessing that somewhere along the way compatibility broke, but I don't know that to be the case.
Also, if those recipes were edited or created in "Simple" mode there are a number of data corruption issues. Be sure you do not allow Simple mode to be used (you can disable it in Recipe Admin). Simple will be removed soon.
#15
The dump file is attached. I have not set the module to "simple". You will see that some recipes have been entered strictly for testing purposes and contain entries written when slap-happy. Enjoy.
Thanks for your help.
mrweaver
#16
Yep, definitely some table differences with the current format.
Attached is the current schema.
Here are the diffs I can see:
recipe table:
nid field need to be auto_increment (You may have duplicates in this field in the data)
yield field needs to be int(11)
recipe_node_ingredient table:
unit_id int(10) UNSIGNED
quantity float
recipe_unit table:
id int(10) UNSIGNED auto_increment
name varchar(255) NULL=Yes Default=NULL
abbreviation varchar(8) NULL=Yes Default=NULL
metric int(10) UNSIGNED NULL=No Default=0
type varchar(6) NULL=No Default=Mass
#17
Hmm.
I think this has happened to others not just mrweaver as evidenced by some Issues. So even if he is willing to forget it and recreate these recipes in the new database, there maybe be are other folks who are in a worse scenario.
Basically I am not too comfortable with DB repair. I was hoping it was something else. :-)
I could script alter the old tables to match our current no problem, except..
.. I'm not sure that in of itself is all that is required to fix this.
.. I'm not sure if that alter would need to be put into the .install script for all previous-version upgrades or selectively applied.
John do you have any ideas or want to claim this one?
#18
I don't really have that many recipes, as you can see. I have this on an intranet. But, if I insert the recipe data into tables created with the new schema, will that work, or do I have to manually enter the data?
mrweaver
#19
I added a new update.php handler this morning. If you get a new dev copy tonight,
you can re-run update.php. You'll have to manually choose Recipe - 6000 from the pulldown.
There should be one error on update, but that is OK.
#20
Is this the one error?
I edited an old recipe and the ingredients did save, but yield and instructions still did not.
#21
Yep, that's the one error.
If you can dump your 4 recipes tables again, I could check them against 6.x and see if we are there.
Once we can verify the database, we should at least be a step closer. I wish we were getting some error messages.
#22
There might also be some PHP errors recorded in Reports>Recent Log Entries..
#23
Here you go.
#24
The tables are exactly correct. Also, I just made a change to the recipe update function. Let's see if that does it.
It should be in tonight's dev snapshot(Feb10).
#25
Update #6100
Yield and instructions do not save.
#26
The Feb 10 nightly snapshot hasn't been generated yet:)
Currently it's still:
6.x-1.x-dev Download (37.88 KB) 2010-Feb-09
#27
#28
#29
I downloaded the most recent one (got my date right, this time!) and still, when I edit a recipe whose yield and instructions have not saved, they still don't save.
#30
Which recipe or node id is it?
#31
I think I found it! No really:) I think so...
Give this a try.
#32
chicken waldorff salad, node/911
#33
Yep, node 911 does not have an entry in the recipe table.
The fix in #31 above should handle that.
#34
You got it! I will edit my other recipes, but suffice to say, chicken waldorff salad is a go!
#35
Committed the fix. It should show up in the 6.x-1.x-dev snapshot dated Feb12.
Thanks for posting back so often on this issue. It really helps resolve these hard to duplicate problems.
#36
No worries, glad i could help. I'm happy to have this working again.
#37
Thanks for chasing this down John..
#38
Automatically closed -- issue fixed for 2 weeks with no activity.