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.

Comments

emmajane’s picture

I'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?

emmajane’s picture

Version: 5.x-1.x-dev » 6.x-1.0-beta1
StatusFileSize
new3.35 KB

This 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.

jvandervort’s picture

Version: 6.x-1.0-beta1 » master
Status: Needs review » Fixed

Thanks for the patch. Committed to HEAD.

scottprive’s picture

Version: master » 6.x-1.x-dev
scottprive’s picture

Assigned: Unassigned » jvandervort
Status: Fixed » Active

The TINYINT usage will break Postgresql support (we have a few such installs).
Two alternate ideas are SMALLINT, or postgres-specific checks.

jvandervort’s picture

Status: Active » Fixed

Since Drupal core is moving to int-normal, let's just go there. Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jvandervort’s picture

Just so you know, drag and drop ordering was committed to dev.