I'm sorry if it's duplicated, there is so many issues that I'm not patient to read...

When editing a CCK Node with a 3-level (my case; but I think that it'd happens with n-levels) HS Content Taxonomy Field, I edit the 1st or the 2nd levels, and the values of drop-down boxes of next levels (respectively, 2nd and 3rd levels, or 3rd level) aren't being refreshed with the new content that it should be. Instead, it keeps the same content that was loaded with the page. I have to push the preview button to refresh the field for each level so it can work. Even doing that, I'm receiving now warning messages (the module version before 24/Jun didn't emitted these warnings):

* warning: Cannot use a scalar value as an array in /var/www/html/sites/all/modules/cck/content.module on line 606.
* warning: reset() [function.reset]: Passed variable is not an array or object in /var/www/html/sites/all/modules/content_taxonomy/content_taxonomy.module on line 281.

In this case, it doesn't matter any other configuration (lineage or deepest term, any or deepest level, etc.); I tried to put the drop box with level 1, but it isn't appearing (I think this is another bug that is not linked with this, though).

Thanks for attention.

Comments

wim leers’s picture

Assigned: Unassigned » wim leers

You must have configured the "depth" field setting of your content_taxonomy field. It seems something was wrong with my fix for http://drupal.org/node/264789. Reproduced.

wim leers’s picture

Title: Problems reloading sublevels when editing a CCK Node » Regression: problems loading sublevels with hs_content_taxonomy
Component: Code » Code - Content Taxonomy
Status: Active » Fixed

Fixed. I made a bad assumption about taxonomy_get_tree(). That's what you get when you've been "out" for more than a month.

Vuds’s picture

Status: Fixed » Active

Still got that too in the last version (25/Jun 9AM).

Now it appears that is just when I try to edit a node. Creating is perfect.

Still appearing the same warnings when pressing the preview button.

You had commented about the depth, I had set to 3 in the 3-level taxonomy field.

Thanks!

Vuds’s picture

Warnings trying to save a edited node after 2 preview buttons pressed to renew the 2 sub-levels:

* warning: Cannot use a scalar value as an array in /var/www/html/sites/all/modules/cck/content.module on line 606.
* warning: reset() [function.reset]: Passed variable is not an array or object in /var/www/html/sites/all/modules/content_taxonomy/content_taxonomy.module on line 281.
* warning: Cannot use a scalar value as an array in /var/www/html/sites/all/modules/cck/content.module on line 606.
* warning: reset() [function.reset]: Passed variable is not an array or object in /var/www/html/sites/all/modules/content_taxonomy/content_taxonomy.module on line 281.

It's not saving the new content for the field neither keeping the old content, the field becames empty.

wim leers’s picture

You're sure you've got the save option set to "tag"?

/me curses at content_taxonomy.module

Vuds’s picture

I'm saving it as both... Any problem here?

wim leers’s picture

Yep, it turns out to not work quite right. Please set it to "tag" for a moment and test again.

FYI: this is why I curse at the content_taxonomy module. It's a buggy, badly commented piece of code.

Vuds’s picture

No, nothing done yet. Putted only as tag saving as requested.

The fields in my tests forms had empty because of the error. Now when I go editing a node, the field starts clean (just with the inside label). I choose one value, AJAX tries to reload, when finished the sublevels dropdowns don't appear anymore. Then I go to preview form button, got the same warning messages, but sublevels appears. If I select a 2nd-level different value than the first, again AJAX tries to reload 3rd-level, but it keeps bringing the values referent to the first 2nd-level, not the chosen last. Preview again, more warning messages, bring the correct list for 3rd-level. Save it, receive more warning messages as #4, but still empty.

Speaking of saving mode, I was going to ask why the value stills 0 in the cck node table... but I think I understood with your explanation.

Vuds’s picture

In a fresh new cck node of a fresh new cck content type (but the same 3-level vocabulary):

warning: reset() [function.reset]: Passed variable is not an array or object in /var/www/html/sites/all/modules/content_taxonomy/content_taxonomy.module on line 281.

when saving the form; In this case, AJAX is working perfectly; but it's not saving any data anyway, in any configuration. :/

PS: I don't know if it helps, but this vocabulary isn't 3-level constantly; I can have choices that have 1st, 2nd or 3rd levels of depth. Even knowing that, saving a 1st, 2nd or 3rd depth field value brings me the bug, considering lineage or not.

wim leers’s picture

Please post your HS config. Go to admin/settings/hierarchical_select/configs and export the appropriate config, then copy/paste it here.

Vuds’s picture

Config:

$config = array(
'config_id' => 'content-taxonomy-field_bio_localizacao',
'save_lineage' => 1,
'enforce_deepest' => 0,
'node_count' => 0,
'level_labels' => array(
'status' => 1,
'labels' => array(
0 => 'Escolha:',
1 => 'Estado:',
2 => 'Cidade:',
),
),
'dropbox' => array(
'status' => 0,
'title' => 'Sua Localização',
'limit' => 5,
),
'editability' => array(
'status' => 0,
'item_types' => array(
0 => '',
1 => '',
2 => '',
),
'allow_new_levels' => 0,
'max_levels' => 2,
),
);

Other useful information:

Drupal 5.7
Configuration file Protected
Cron maintenance tasks Last run 2 hours 15 min ago
You can run cron manually.
Database schema Up to date
File system Writable (public download method)
GD library 2.0 or higher
Hierarchical Select All updates installed. jQuery Update 1.x installed.
Hierarchical Select Views Taxonomy The Views module is new enough.
JQuery Update Installed correctly
The current installed version of JQuery is 1.1.2
MySQL database 5.0.38
PHP 5.2.1
PHP register globals Disabled
Unicode library PHP Mbstring Extension
Web server Apache/2.2.3 (Ubuntu) mod_python/3.2.10 Python/2.5.1 PHP/5.2.1 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_perl/2.0.2 Perl/v5.8.8

Name Version
Computed Field 5.x-1.2

Content 5.x-1.7

Content Copy 5.x-1.7

Content Taxonomy 5.x-1.x-dev

Content Taxonomy ActiveSelect 5.x-1.x-dev

Content Taxonomy Autocomplete 5.x-1.x-dev

Content Taxonomy Options 5.x-1.x-dev

Fieldgroup 5.x-1.7

Link 5.x-2.1

Node Reference 5.x-1.7

Number 5.x-1.7

Option Widgets 5.x-1.7

Text 5.x-1.7

User Reference 5.x-1.7

Name Version
Block 05/07/08
Filter 05/07/08
Node 05/07/08
System 05/07/08
User 05/07/08
Watchdog 05/07/08

Name Version
Date 5.x-2.0-rc

Date API 5.x-2.0-rc

Date Copy 5.x-2.0-rc

Date PHP4 5.x-2.0-rc

Date Popup 5.x-2.0-rc

Date Repeat API 5.x-2.0-rc

Date Timezone 5.x-2.0-rc

Name Version
Devel 5.x-0.3
Devel Node Access 5.x-0.3
Generator 5.x-0.3
Macro 5.x-0.3

Name Version
Content Taxonomy Facets 5.x-1.x-dev

Name Version
Hierarchical Select 5.x-3.x-dev

Hierarchical Select Content Taxonomy 5.x-3.x-dev

Hierarchical Select Views Taxonomy 5.x-3.x-dev

Name Version
Active select 5.x-1.0

Automatic Nodetitles 5.x-1.1
Bio 5.x-1.2
Brazilian IDs 5.x-1.2

Pathauto 5.x-2.2

Taxonomy import/export via XML 5.x-1.0

Taxonomy Manager 5.x-1.0

Token 5.x-1.11

Name Version
User Tags 5.x-1.x-dev

Name Version
JQuery Interface Library 5.x-1.0

JQuery Update 5.x-1.0

Name Version
Content Taxonomy Views 5.x-1.x-dev

Views 5.x-1.6

Views RSS 5.x-1.6

Views Theme Wizard 5.x-1.6

Views UI 5.x-1.6

autonetex’s picture

I have the same symptoms:
warning: reset(): Passed variable is not an array or object in /var/www/vhosts/httpdocs/modules/content_taxonomy/content_taxonomy.module on line 281.

error

and the value is not saving after node submit.

wim leers’s picture

You've got save_lineage enabled, but is the "multiple values" setting enabled for that field?

Vuds’s picture

No, that was not set because I was wanting to have only one of each 3-level term (1 lineage only, let's say).

But, because you asked, I tried then to test with "multiple values" enabled. So:

- In the first content type that I was using, it appeared the dropbox (but I had not configured that). Tried to select any value from 1st level, but again did not reloaded and showed the 2nd level. Tried to "add" to the dropbox, it didn't. Preview button, same warnings, brought me the 2nd and 3rd levels. Selected any different value in 2nd level, it didn't actualized the 3rd item. Tried to "add", it didn't. Again preview button, same warnings, 3rd level actualized. Tried to "add", nothing. Tried to send the form, same warnings as #4, value is empty. (this form have others non-HS content taxonomy fields; and it's a bio node).

- In the content type that I created to test (mentioned on #9), it also appeared the dropbox (and I also had not configured that). But here it's working perfectly; I'm just concerned to the point that with multiple select it's permitted to add more than 1 lineage. It saved, and then I could also return to edit it normally. This form doesn't have others content taxonomy fields YET, I'll put some to test again and verify if it happens the same as above. also, this not a bio node, but i'll try to elect it as one and test it too.

Vuds’s picture

Okay, I've tested more and now I can refine:

- Without multiple select, the content type brings me the dropbox even if I had not configured it, sending the form gives me all the same warnings as before; but, the unexplainable happened, the ajax loading sublevels are now working perfectly (code or variables junk on the older form? I don't know... but I cleaned the cache repeatedly times, deleted all content nodes of this type and tried recreate them, and it stills not working as the new content type);

- With multiple select, it still brings me the dropbox without any configuration about, but it's working perfectly, for adding and for editing. Additionally, if I send the form with no value inside (and I had not marked as required), I have the same warnings as above. And it causes me another problem; I want one lineage only to be save!

Now I'll try to gave the same look-like for the new form as the older was, I'll put all the other fields that I had in there and test one by one, if I got any news, I return to post here...

Thanks for attention!

wim leers’s picture

Title: Regression: problems loading sublevels with hs_content_taxonomy » Regression: "multiple values" field setting enables the dropbox

Man, this is weird! I reproduced the dropbox issue.

wim leers’s picture

Status: Active » Fixed

Fixed, try again with the newest version.

It was just a bad assumption in the code, I was effectively enforcing the dropbox when "multiple values" was enabled.

Vuds’s picture

Title: Regression: "multiple values" field setting enables the dropbox » Regression: problems loading sublevels with hs_content_taxonomy inside a field group
Status: Fixed » Active

I found it!

The problem happens when we have the HS field inside a field group!

wim leers’s picture

Status: Active » Fixed

Uhm… and that has been fixed. You're not using the latest version of the code then. You must do a CVS checkout, the tarball only updates every x hours…

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

jdotti’s picture

Hi,

Sorry to re-open this issu ...

I am using the last version of content_taxonomy and HS but a still have this message :
Passed variable is not an array or object in sites\all\modules\content_taxonomy\content_taxonomy.module on line 281

JD