Notice: Trying to get property of non-object in smartqueue_taxonomy_nodequeue_subqueue_title() (line 217 of ... sites/all/modules/contrib/nodequeue/smartqueue.module).

smartqueue_taxonomy_nodequeue_subqueue_title() checks only to see if a term ID is true, but does not test whether that term currently exists.

Comments

jweowu’s picture

Status: Active » Needs review
StatusFileSize
new531 bytes
jweowu’s picture

StatusFileSize
new898 bytes

Dealing with side-effects of ignoring the invalid terms.

tripper54’s picture

Status: Needs review » Reviewed & tested by the community

Seems to work OK for me. I was getting this error after deleting a term.

fizk’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work

After applying this patch and removing a term, adding more terms, etc., I saw multiple subqueues named "6" (I'm assuming this was the old term ID for the term "three"). After adding the removed term, I saw the "6" subqueue be replaced by "three". These behaviours don't seem stable, so I think this needs more work.

jweowu’s picture

What do you think the title should be in the situation where the term doesn't exist?

I think it's useful to include $reference in the output in some way, as it provides some kind of identification.

Perhaps something along the lines of sprintf("Invalid term reference: %s", $reference) ?

jenlampton’s picture

Status: Needs work » Needs review
StatusFileSize
new1.21 KB

Here's a reroll of the patch, slightly different approach.

jweowu’s picture

Regression from the previous patch: You're assuming that the taxonomy_term_load returned an object.