The current load of ingredients is by the node ingredient record id, essentially meaning it is a time-based order. When updating ingredients, this can cause some confusion. During edit, some updates of ingredients will suddenly fall to the bottom of the list with no obvious reason.
This patch adds a "weight" column to the recipe_node_ingredient table. It also alters the recipe_ingredients_diff and save function to use the order of the ingredients as the weight. Down the road this would open up the door for "move up" and "move down" controls similar to views. For now this at least keeps things in the same order you entered them at the node level.
I took an initial pass at writing the upgrade for this database change, and altering hook_install for both database platforms. Needs testing and review.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | ingredient_weight-D6.patch | 3.35 KB | emmajane |
| recipe_order_v1.patch | 3.83 KB | seanbfuller |
Comments
Comment #1
emmajane commentedI'm +1 with this problem; however, I'm running version 6 of the module. I'm currently running BETA-1, should I work with the D6-dev version or are most people still on BETA1?
Comment #2
emmajane commentedThis is the D6 version (applied against BETA1). I still have the problem of needing to reorder the recipes that have already been entered. I'm working on that now.
Comment #3
jvandervort commentedThanks for the patch. Committed to HEAD.
Comment #4
scottprive commentedComment #5
scottprive commentedThe TINYINT usage will break Postgresql support (we have a few such installs).
Two alternate ideas are SMALLINT, or postgres-specific checks.
Comment #6
jvandervort commentedSince Drupal core is moving to int-normal, let's just go there. Committed.
Comment #8
jvandervort commentedJust so you know, drag and drop ordering was committed to dev.