Yield Field Not Reflecting
| Project: | Recipe |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I was wondering if anyone knows why the "yield" field comes up blank after entering information?
I checked my "MySql" table and everything is present...in the "yield" field! The form allows for the entry but doesn't display when rendered. Also, I noticed that the "Change", "Halve" & "Double" buttons work, if you know what the yield is in the first place. Not sure if this is the correct function but, when I do enter a number in the yield box and click on one of the buttons, the recipe changes as it should but the yield box goes blank again! So, the information is there, and it can be manipulated, but is not rendering!
Don't know if this helps, but I went to the source page and checked out the code:
<div class="content"><div class="recipe-summary"><div class="box">
<h2>Summary</h2>
<div class="content"><table><tr><th>Yield</th><td><form action="/node/616" accept-charset="UTF-8" method="post" id="recipe-custom-yield-form">
<div><fieldset><div class="form-item" id="edit-custom-yield-wrapper">
<input type="text" maxlength="4" name="custom_yield" id="edit-custom-yield" size="2" value="" class="form-text" />
</div>
<input type="submit" name="op" id="edit-submit" value="Change" class="form-submit" />
<input type="submit" name="op" id="edit-halve" value="Halve" class="form-submit" />
<input type="submit" name="op" id="edit-double" value="Double" class="form-submit" />
</fieldset>
<input type="hidden" name="form_build_id" id="form-0cdbc2f6e6f55f545b4b97d6eaf363ff" value="form-0cdbc2f6e6f55f545b4b97d6eaf363ff" />
<input type="hidden" name="form_token" id="edit-recipe-custom-yield-form-form-token" value="25389829b8031e1eaefe11489cd19710" />
<input type="hidden" name="form_id" id="edit-recipe-custom-yield-form" value="recipe_custom_yield_form" />It appears, at least to me, that the yield is being called for from the DB!
System Info:
Drupal 6.2
Recipe Module 6.x-1.0-beta1
MySQL DB 5.0.45
Checked on Firefox v2, IE v6
Otherwise, I really like this module...it works great!
Thanks

#1
I have also just noticed the same problem with version 6.0 beta. :(
Also if one wants to edit a recipe, the form ingredients' form comes empty, unlike in D5 where it's pre-populated with existing values.
Has anyone figured out how to solve this?
v.5 functions well and I have it on a D5 site for about 1 year. I also LOVE it.
Meanwhile, I was using the Node Images module to add multiple images to/within a recipe, but there's no sign of a D6 version.
Can anyone anyone suggest any equivalent or better alternative for D6?
Unless I use the "attachment" method of the image module wrongly, I preferred the above as the images + recipe are on the same page.
#2
Well, as mentioned here http://drupal.org/node/250117 the problem of the ingredients missing on submission or during editing comes up if one "previews".
After reading that bug report, I edited a recipe whose ingredients had been ignored and they appeared - also in the table during subsequent further editing.
#3
Hello,
I love this module, I do not know if this can help but if you click on "Printer-friendly version" the yield appears correctly.
Thanks !
#4
I confirm what cicciobombolo said in #3, it indeed shows the Yield on "Printer-friendly version" page (Export HTML).
Also i add that Yield appears well on these pages:
-"Preview" (but w/no ingredients)
-"Edit"
-"Export to RecipeML"
-"Printer-friendly version" (Export HTML)
Appears blank:
-On "View" page
I decided to write the Yield (how many persons) under "Description" and under "Notes" a simple hint to my visitors wishing to use the Yield fieldset for calculations. I know this is not the basic use of the module but, at least it HELPs!
Untill someone find a solution for it!!!
P.S.: I've been chkng "recipe.module" but haven't found anything yet. Also chkd difs between version 5.
#5
Ok, as lionheart8 said in #1, i confirm that version "recipe-5.x-1.0.tar.gz" for Drupal 5.x running on my server:
-MySQL 5.0.51b
-PHP 5.2.6
-Apache/2.2.8 (Unix)
is working fine!!!
Information:
1- Indeed "Yield" shows under pages:
-Edit
-Preview
-View
-Export to RecipeML
-Printer-friendly version (Export HTML)
2-But ingredients DOES not show under "Preview"
Right?
#6
On 2008-Sep-19, today, we get a new dev version that still:
-Not showing Yield field
-Not correcting the issue with the "Preview" page not showing ingredients
#7
Here's a fix
I was tracing the code and found the issue for 6.x-1.0-beta1. The first agrument of recipe_custom_yield_form() is an empty form state collection. When calling drupal_get_form('recipe_custom_yield_form', $node), $node actually comes in as the second argument of recipe_custom_yield_form().
Not sure if this is 'proper' or not, but I added a second field to the form and set the yield default value accordingly.
To fix, just replace the original function with this one: (i only changed 2 lines, and added 1 more)
function recipe_custom_yield_form($form_state=array(), $node=null) {
$yield = $node?$node->yield:null;
$form['custom_yield_container'] = array(
'#type' => 'fieldset',
'#collapsible' => FALSE,
'#collapsed' => FALSE
);
$form['custom_yield_container']['custom_yield'] = array(
'#type' => 'textfield',
'#default_value' => $yield,
'#size' => 2,
'#maxlength' => 4
);
$form['custom_yield_container']['submit'] = array(
'#type' => 'submit',
'#value' => t('Change')
);
$form['custom_yield_container']['halve'] = array(
'#type' => 'submit',
'#value' => t('Halve')
);
$form['custom_yield_container']['double'] = array(
'#type' => 'submit',
'#value' => t('Double')
);
return $form;
}
Love the module by the way, great work.
#8
Could there be the amount in a drop down box. Such as units, dozen, and such...
#9
THANK YOU! Works like a charm!
#10
#7 Fixed this issue for me. Suggest pushing to next release. Unfortunately I have not mastered patching yet, or I would offer one up! I have changed this to a bug with Critical status because the recipe is worthless without this field output on the recipe page.