Closed (duplicate)
Project:
Drupal core
Version:
6.x-dev
Component:
taxonomy.module
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
26 Oct 2007 at 13:48 UTC
Updated:
31 Oct 2007 at 18:55 UTC
Jump to comment: Most recent file
Comments
Comment #1
marcingy commentedAlso affects none free tagged taxonomys
notice: Trying to get property of non-object in D:\drupal6\modules\taxonomy\taxonomy.module on line 449.
When the preview page is returned the term is not set.
Comment #2
marcingy commentedOnce the node is saved and preview is selected a different set of errors is generated:
notice: Trying to get property of non-object in D:\drupal6\modules\taxonomy\taxonomy.module on line 48.
notice: Trying to get property of non-object in D:\drupal6\modules\taxonomy\taxonomy.module on line 49.
notice: Trying to get property of non-object in D:\drupal6\modules\taxonomy\taxonomy.module on line 74.
notice: Undefined index: in D:\drupal6\modules\taxonomy\taxonomy.module on line 868.
notice: Trying to get property of non-object in D:\drupal6\modules\taxonomy\taxonomy.module on line 75.
notice: Trying to get property of non-object in D:\drupal6\modules\taxonomy\taxonomy.module on line 75.
notice: Trying to get property of non-object in D:\drupal6\modules\taxonomy\taxonomy.module on line 78.
notice: Trying to get property of non-object in D:\drupal6\modules\taxonomy\taxonomy.module on line 51.
notice: Trying to get property of non-object in D:\drupal6\modules\taxonomy\taxonomy.module on line 449.
Comment #3
JirkaRybka commentedThis set also occurs without free tagging - just make the vocabulary not required, and select no term.
Comment #4
marcingy commentedThe free tagging issues are caused because
// Free tagging vocabularies do not send their tids in the form,
// so we'll detect them here and process them independently.
Therefore a term is never loaded hence the reason why the links aren't displayed - I'm guessing that it is a similar issue when the value is not to none for standard tags.
Errors on lines 48,49,74,75 and 78 are caused by this.
Also for the issue on line 449 the object node->taxonomy hasn't be correctly innitalised.
Comment #5
robloachSubscribing after encountering something similar.
Comment #6
cburschkaAll of these can be fixed in the obvious way, by adding an is_object() condition to the parts of the code that trigger the notice. This does not change the behavior of the code, but works for E_ALL compliance.
After applying this patch on my test site, taxonomy.module no longer triggered notices on previewing or saving a node with freetagging vocabulary fields.
----
However, there is a part to this issue where a different behavior may be desired. Namely, when a node is previewed, its free-tagged vocabulary is not displayed at all. Changing this would be more of a feature, but the suggestion could well be placed here:
Alternatively, we may generate "pseudo-links" that show these keywords (but do not lead anywhere). But this can potentially confuse users who try to click on the links.
Or, and this takes most effort, we can do a preliminary match on the terms entered and generate fully-qualified links for those (but not add new terms to the database yet). This option still leaves open whether new terms should have pseudo-links or stay invisible.
Comment #7
marcingy commentedAlso it appears as if an empty taxonomy is also being apended to a node.
I have a node with a single term associated with it. When I call taxonomy_node_get_terms the following array is returned
Array ( [1] => Array ( [tid] => Array ( [5] => stdClass Object ( [tid] => 5 [vid] => 1 [name] => food [description] => [weight] => 0 ) ) ) ) Array ( [1] => Array ( [tid] => Array ( [5] => stdClass Object ( [tid] => 5 [vid] => 1 [name] => food [description] => [weight] => 0 ) ) ) [] => Array ( [tid] => Array ( ) ) )
Note the empty tid at the end.
In addition the following errors are thrown
notice: Trying to get property of non-object in D:\or6\modules\taxonomy\taxonomy.module on line 491.
notice: Trying to get property of non-object in D:\or6\modules\taxonomy\taxonomy.module on line 492.
notice: Trying to get property of non-object in D:\or6\modules\taxonomy\taxonomy.module on line 493.
notice: Trying to get property of non-object in D:\or6\modules\taxonomy\taxonomy.module on line 500.
The node is simply being viewed and is otherwise valid
Comment #8
desbeers commentedhttp://drupal.org/node/163728 deals with the notices and a lot more like lost of free-tags and resetting to default of other tags on preview. I mark this as duplicate.