Closed (fixed)
Project:
Recipe
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Aug 2007 at 09:35 UTC
Updated:
12 Nov 2007 at 22:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
zmove commentedI find a solution to the problem so I post it as a patch.
Feature description :
When adding a new recipe, the module now check on database if there is a node that have the exact title of one ingredient. If yes, he register the node id into a new column named "link" in {recipe_ingredient}.
When showing the recipe, the module now check if there is a node id in the link column. If yes, it create a link on this node.
I have problem to create patch so I upload all the recipe.module, if somebody can make it a patch it could be great (patch creation bug on my nasty windows computer...)
As I said, this modification require a new column on the {recipe_ingredient} table, to add it just put this code on your SQL textarea (using phpmyadmin) (don't forget to add prefix if you have one)
Comment #2
nancydruThe "correct" way to add a column is to add a recipe_update_xxxx function to the recipe.install code. It is very simple.
Comment #3
brdwor commentedI like this idea. Please upload a reciple.module file if you can not create a patch. Also, needs a modified recipe.install.
Comment #4
zmove commentedI already uploaded the recipe.module modified above...
I modify a lot of things on my recipe.module after this modification so I can reupload it anymore. If the patch above is not good, I will try to create another with just the node reference modification, but later, my deadline approach and I don't have time for now.
Comment #5
webchickOk, I *think* this is the original patch... I copy/pasted the + lines of the patch above (which seemed to be the entirety of the .module file), and then pasted that over a checkout of recipe.module from August 6, and cleaned up a few coding style things.
I'm not sure i this patch is the optimal way to solve this, but at least it can now be properly reviewed. I'll roll in the update path to add the column when I get home later.
Comment #6
webchickHere's the full thing, with the upgrade path.
Comment #7
marble commentedApplied the patch, thankyou.
Comment #8
wwmv commentedThe patch introduced a new db table cell 'link' (recipe_ingredient table) in .module but did not change the .install file correct. The bug occurs when the module is installed the first time.
The exact error is:
user warning: Unknown column 'i.link' in 'field list' query: recipe_load_ingredients SELECT ri.id, i.name, i.link, ri.quantity, ri.unit_id, u.abbreviation, ri.ingredient_id FROM _v1recipe_node_ingredient ri, _v1recipe_ingredient i, _v1recipe_unit u WHERE ri.ingredient_id = i.id AND ri.unit_id = u.id AND ri.nid=1114 ORDER BY ri.id in /var/www/drupal-5-2/includes/database.mysql.inc on line 172.To fix this just insert the 'link' entry in hook_install, {recipe_ingredient}. I tried to come up with a patch but I'm new to this.
Comment #9
marble commentedThanks. I'm afraid I didn't notice you'd attached a patch until after I'd checked in the change, so didn't credit you in the checkin comment, but your patch was appreciated and I made pretty much the same fix you had in the patch (but for the pgsql version too).
Hopefully the current version will work for people's new installs as well as upgrades. Sorry about the problems!
Comment #10
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.