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
Comments
Comment #1
lionheart8 commentedI 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.
Comment #2
lionheart8 commentedWell, 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.
Comment #3
cicciobombolo commentedHello,
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 !
Comment #4
errement commentedI 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.
Comment #5
errement commentedOk, 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?
Comment #6
errement commentedOn 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
Comment #7
mmilano commentedHere'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)
Love the module by the way, great work.
Comment #8
webluke commentedCould there be the amount in a drop down box. Such as units, dozen, and such...
Comment #9
michellepurestock commentedTHANK YOU! Works like a charm!
Comment #10
jlmeredith#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.
Comment #11
lionheart8 commentedHi
For some reason I dont quite get, I replaced that whole function in recipe.module 6 Beta1 with the one shown above but the problem of unpopulated ingredient fields persists.
What could I be doing wrong?
I have had to write an explanation to users, telling them to reckon with refilling ingredients whenever they edit & only do so WHEN reviewing & not before. Quite cumbersome if one has many ingredients. :(
The D 5 version on another site has never had this.
Comment #12
jbemmel commentedSee issue http://drupal.org/node/263432
The problem is that in Drupal 6 the function API has changed, function recipe_custom_yield_form needs an extra parameter '$form_id' which is mandatory (but unused here)
Adding the parameter fixed the issue for me
Comment #13
lionheart8 commentedThanks for pointing me to this, I used that solution and for the first time since I upgraded to Drupal 6, I was able to see YIELDS!!!!
I still have another problem that has persisted, though:
Do you have anything like this or if you solved it, what did you do?
The combination of the 2 had made me lose enthusiasm for submitting or editing recipes & encouraging site guests to do the same.
Comment #14
jbemmel commentedI didn't try the preview button yet, but when I did I noticed the issue. It turns out to be an issue in function recipe_form: for preview the 'ingredients' are an array, while for submit they are an object
A fix for the code is below (still needs some cleanup):
Comment #15
lionheart8 commentedThat seems to do the trick!!!!!
In a preliminary test, I edited a recipe & on "previewing" the ingredients did not vanish, needing filling them in anew.
This has been very annoying & now after almost a year I dont regret upgrading to D6 - as far as the recipe module is concerned, which apparently is a key part of my community site.
So I have to go to the recipe section & edit the long submission instructions' section which told users how to deal with the 2 problems, one mentioned here & the other of the not appearing "yield" which has also been solved.
Thanks again - but in case there's some hiccup somewhere, I think I know where to turn - especially since you said the code "still needs some cleanup". For now, it looks clean. ;)
Regards
Comment #16
marble commentedThanks everyone. I've committed the fix as well as the patch for the ingredients issue from jbemmel.