Closed (fixed)
Project:
Recipe
Version:
6.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 May 2008 at 20:13 UTC
Updated:
10 Jul 2009 at 12:00 UTC
When viewing a recipe the yield box is not populated with the submitted yield (yes teh value of the yield was submitted and did get saved). Entering a yield in the viewed form does cause teh recipe to calculate and show the proper values, but it never shows what the default yield was to begin with. example recipe
Comments
Comment #1
DomeMinion commentedThe "halve" & "double" buttons don't seem to work either.
Comment #2
swirtThe buttons work, but they depend on a value to be in that box. If you place a value in the box and press half or double, it will process it based on that value. It just needs the value to be populated from the node, but it isn't happening.
Comment #3
swirtI found the problem.
near line 1475 this function is defined "function recipe_custom_yield_form($node) {"
and near line 1397 the function is called using drupal_get_form
"$yield = drupal_get_form('recipe_custom_yield_form', $node);"
For some reason inside the function, $node loses its value.
I am not sure why $node loses its value within the function. I hacked my way around the problem by making a global variable before the function is called and then accesing it within the function. (not ideal I know.)
Comment #4
icymetal commentedWhen I enter a value into the YIELD field and submit, it does not show in that field. I tried to enter a number and use the double or half buttons but this doesn't work either. Also, when I go back to edit it, it's empty. Same with the INSTRUCTION and NOTES fields.
Comment #5
IanBezanson commentedLine 1473 is:
function recipe_custom_yield_form($node) {
should be:
function recipe_custom_yield_form($form_id, $node) {
in Drupal 6, any form function declaration expects (well, requires) $form_id as the first element. As it stands, when you reference $node within that function, you're really referencing the $form_id element being passed in first. This change opens up the form to work as expected.
Comment #6
lionheart8 commentedHi
thanks for this.
It solves the Yield problem. I have not seen "yield" in months for all recipes!!!!
There's still a problem, though when editing, once one goes to "Preview" the ingredients disappear & have to be filled in anew :((
I suppose there's also the issue when submitting a new recipe, having to fill in the ingredients during previewing & NOT before for the same reason.
Any solution to this?
Comment #7
jbemmel commentedSee http://drupal.org/node/268265#comment-1696630
Comment #8
marble commentedThanks for your help, everyone, and apologies for taking so long, but I have now committed this fix to CVS.