I ran into this debugging an issue for a client where we had used weight module on certain content types, but not anymore. So the content items created for these bundles had weights in weight_weights table, but newer ones did not. The newer items had an unconfigured weight, which when sorted in views meant they were lighter than weights with a defined weight (generally zero.)

I ended up just purging the records for these items from the weights table using the SQL below, since we could safely lose that data.

delete weight_weights from weight_weights left join node on weight_weights.entity_id = node.nid where node.type not in (select type from weight_settings where weight_enabled = 1);

I am wondering, though - should weight module be aware of a bundle's status in weights_settings before it returns a value? Or should it purge values from the weights table when a node has weight module disabled?

Comments

davisben’s picture

Status: Active » Fixed

I added an option in the Weight settings fieldset to clear all weights for that particular content type. This way weight can be disabled and restored if needed, but weights can also be cleared.

Status: Fixed » Closed (fixed)

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