Hello, when I try to edit a node with an HS widget it appears to get stuck in a loop once it starts to load the java and all that gets displayed is a white page that never stop loading with:
disable rich-text

I've upgraded to the latest dev (was on the beta 1 release but had the common.inc problems) and installed jqueury rc 2 (and copied all files in the misc folder across). It seems to work fine on the settings page but once you try it for real it all goes horribly wrong! There are no errors in the status report. I have it set to unlimited depth here, but have also tried restricting it. Here's the content export (it seems a bit shorter than previous ones I've seen...):

$content[fields]  = array (
  0 => 
  array (
    'widget_type' => 'content_taxonomy_hs',
    'label' => 'taxonomy',
    'weight' => '0',
    'description' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '0',
    'save' => 'tag',
    'vid' => '11',
    'tid' => '0',
    'depth' => '',
    'field_name' => 'field_taxonomy',
    'field_type' => 'content_taxonomy',
    'module' => 'content_taxonomy, hs_content_taxonomy',
  ),
);

Comments

matthew_ellis24’s picture

here's the full export:

$config = array(
  'config_id'       => 'content-taxonomy-field_taxonomy',
  'save_lineage'    => 1,
  'enforce_deepest' => 1,
  'node_count'      => 0,
  'level_labels' => array(
    'status' => 1,
    'labels' => array(
      0 => 'Division',
      1 => '',
      2 => '',
      3 => '',
    ),
  ),
  'dropbox' => array(
    'status'    => 0,
    'title'     => '',
    'limit'     => 0,
    'reset_hs'  => 1,
  ),
  'editability' => array(
    'status' => 1,
    'item_types' => array(
      0 => 'Division',
      1 => 'Subdivision',
      2 => 'Subgenus',
      3 => 'species',
    ),
    'allow_new_levels' => 0,
    'max_levels'       => 0,
  ),
);
wim leers’s picture

Assigned: Unassigned » wim leers
Status: Active » Postponed (maintainer needs more info)

This: "disable rich-text" makes me suspect that other JS is conflicting somehow. Can you please post a screenshot or mini screencast of what's happening?

wim leers’s picture

And are you sure you're using the latest 3.x-dev version?

matthew_ellis24’s picture

very sure it's the latest yes. Well, it was the latest but I see you've released a new dev that I will try now. I can't screen cast I'm afraid no. But:

When you click on the edit tab the edit page begins to load normally and you see the fields for HS appear with the "you don't have java warning" and it works its way down the page and load everything else, then it seems to load the java for HS last and that's when the page goes white and the rich text link appears.

The rich text link is something to do with TinyMCE. Clicking on it whilst in the loop doesn't do anything.

wim leers’s picture

That's your problem.

HS 2 requires jQuery Update 2, but TinyMCE is incompatible with it (or so i have been told). Disable TinyMCE and it should work.

matthew_ellis24’s picture

still does it with the July 1st dev release

matthew_ellis24’s picture

ta da, looks like I'm moving to FCKeditor then :)

but now it isn't storing the values:

 [field_taxonomy] => Array
        (
            [0] => Array
                (
                    [view] => 
                )

        )

Think I saw another issue on this one though

wim leers’s picture

I'm not sure why this is happening. Go to the field's config page and save the form again, just to make sure that it *is* configured to "save as tag".

matthew_ellis24’s picture

it's definitely definitely set to save as tag. However it's interesting that if you set it to allow level labels and add new levels then it only lets you label the highest parent. I tried opening and saving, and failing that I deleted the field and added a new one. The allow multiple isn't getting checked though. I've read soem of the other issues and I'm not clear if this is needed if you want to save all terms from a single lineage or only if you want to save multiple lineages. Dunno what else to do...

wim leers’s picture

> allow level labels and add new levels then it only lets you label the highest parent.

That's because you have "force user to select from deepest level" enabled then.

"Multiple values" is only needed when save_lineage and/or the dropbox are enabled.

matthew_ellis24’s picture

OK, is that what's stopping it from saving the lineage?

wim leers’s picture

"multiple values" should be selected, and it should automatically be enabled when you've configured HS to save the lineage… it's not for you? Please also export your HS config and post it here.

matthew_ellis24’s picture

hmmm, this is odd, this is the output from the node:

    [taxonomy] => Array
        (
            [1] => stdClass Object
                (
                    [tid] => 1
                    [vid] => 2
                    [name] => News
                    [description] => 
                    [weight] => 0
                )

        )

It's taking terms from the wrong taxonomy here, but not when you export the field setting:

$content[fields]  = array (
  0 => 
  array (
    'widget_type' => 'content_taxonomy_hs',
    'label' => 'taxonomy',
    'weight' => '0',
    'description' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '0',
    'save' => 'tag',
    'vid' => '11',
    'tid' => '0',
    'depth' => '0',
    'field_name' => 'field_taxonomy',
    'field_type' => 'content_taxonomy',
    'module' => 'content_taxonomy, hs_content_taxonomy',
  ),
);

Also as you can see it's not selecting multiple values

matthew_ellis24’s picture

sorry, the first part of my previous post is wrong. I'm not sure what field that's talking about! The field_taxonomy output is still:

  [field_taxonomy] => Array
        (
            [0] => Array
                (
                    [view] => 
                )

        )
wim leers’s picture

I think this is happening because you're mixing a content_taxonomy CCK field with a normal vocabulary. At least, that's what it looks like.

matthew_ellis24’s picture

sorry, I don't understand. I created a new vocabulary (species_taxonomy) and added a new cck field with the HS widget set to use the new vocabulary. Do you mean you think that by using content_taxonomy with a different taxonomy on the same content type it's interfering with HS?

I've tried setting up a new test content type just using the HS widget with the same taxonomy, and a different one, and neither seem to save the lineage

wim leers’s picture

Go to admin/content/taxonomy/edit/vocabulary/1, where 1 is your vocabulary's ID. Then tell me which of the types have been checked.

matthew_ellis24’s picture

Only the species content type (which is the one with custom cck fields).

wim leers’s picture

That's exactly what I thought. Unselect it and save the settings. Now it should work.

matthew_ellis24’s picture

Hmmm, nope. I've tried deleting the taxonomy, creating a new one (assigned to a dummy content type), filling it with terms, then through cck setting it as the associated taxonomy. It shows up and works fine on the edit page but it still isn't saving the terms. I've tried it pretty much every setting I can think of on the vocab page - ranging from creating a new vocab and not changing any of the default settings except single hierarchy, through to changing just about everything. And I've done more or less the same with the cck field.

How have I managed to mess this up so much?!

Is there any chance of a screen shot of the 3 config screens (vocab, cck field and HS config) set up to enable:
a single hierarchy
save entire lineage
force to select from deepest node
creation of new terms
Or any guesses as to what else I've screwed up?
Many many thanks for your patience!!!!!!
Matt

matthew_ellis24’s picture

Hmm, the new dev release doesn't seem to have fixed this. I've tried deleting and uninstalling cck, HS and the vocab and starting from scratch but still end up with it not saving the terms

wim leers’s picture

You will have to give me both Drupal admin access and FTP/SSH access if you want to see this fixed. I can't reproduce this, so that's the only sane way this is going to be fixed.

wim leers’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

This may be somehow connected to http://drupal.org/node/277780, which I just have fixed. So please get CVS HEAD, set the save option to "both" and retry.

Secondly, try using a different widget for your content_taxonomy field. I strongly suspect this is a content_taxonomy issue.

Assuming this is fixed, if it's not, please mark it as "active" again.

matthew_ellis24’s picture

Status: Closed (fixed) » Active

I uninstalled content_taxonomy and it still won't work. I'm not sure what CVS head is, but I downloaded the latest dev release and tried that and I don't get the option to save as both either

wim leers’s picture

That's because the latest dev release isn't updated yet. Wait for beta 2 then.

And did you try what I asked? Did you try using a different widget?

matthew_ellis24’s picture

well I uninstalled it, so it can't be interfering with it if it wasn't there...? I'll reinstall and try a different widget, however HS also wasn't storing values on nodes where it was the only CCK field.

matthew_ellis24’s picture

I tried reinstalling content-taxonomy and picking different widgets for the other taxonomies, and now I get the following error:

# user warning: Duplicate entry '1-368' for key 1 query: INSERT INTO term_node (nid, tid) VALUES (368, 1) in /home/content/c/a/r/carabusonline/html/includes/database.mysql.inc on line 172.

It looks like HS is picking terms from the wrong vocab.

I look forward to beta 2

Matt

matthew_ellis24’s picture

this is interesting. I deleted everything and reuploaded HS, content_taxonomy and all the CCK stuff, and now HS kind of works, but it outputs everything in a random order. ie sometimes the hierarchy is right, sometimes it's reversed and sometimes it's totally random. It always stays with the same order with regard to lineage (ie the same terms in the same lineage will always output the same way), but other terms in other lineages output randomly

wim leers’s picture

Title: stuck in a loop » Selected terms in a Content Taxonomy field not being saved.
Status: Active » Fixed

I can't reproduce this. It also seems to be working for me on your site, although I must admit that I don't understand your taxonomy because it's so scientific.

What you are describing sounds impossible though: it's *impossible* that the hierarchy is being displayed in reverse, because it renders a next level based on the selection of the previous level (i.e. an operation like "get the children for a parent").

Try it on a fresh Drupal site with nothing else but taxonomy and HS, with a basic taxonomy (or import the taxonomy you created on your site). I'm pretty sure it'll work just fine.

In any case, what you are describing now, is a completely new issue. So if you can reproduce the same problem on a fresh site, please create a new issue. But *this* issue, the original issue, is now fixed.

matthew_ellis24’s picture

Hi, I fixed this about an hours ago. It was because HS wasn't enabled in the vocabularly AND the CCK field. Once I enabled it in the vocabulary it worked fine. So to reproduce just disable HS in the "Species Taxonomy" vocabulary.

This is an aside, but although Drupal claims to use taxonomy, when it comes to actually trying to render a proper scientific taxonomy it tends to fall very short!

I now have a problem with it using taxonomy terms from other vocabularies, but that problem is a duplicate of http://drupal.org/node/277780 which you say is fixed in beta 2? To see this look at the author field - it is printing the author AND the parent term from the species taxonomy vocab.

Many thanks for all your help and this great module

matthew_ellis24’s picture

Status: Fixed » Active

I updated to beta 2 in the hope it would let me have author and taxonomy vocab. However now it's all back where I started and it won't save the terms and gives the following error

warning: Illegal offset type in /home/content/c/a/r/carabusonline/html/sites/all/modules/hierarchical_select/modules/hs_content_taxonomy.module on line 294.

I've played with the settings so much with this module that I don't even know where to start now. I have tried associating the vocab with this content type (and not) and I've tried each of the save settings, all of which give that same error. Presumably this is another content_taxonomy clash - in which case I'm beginning to understand your hatred of the module!!!

wim leers’s picture

Eh… that's virtually impossible. The content_taxonomy field handles it in the exact same manner. If this doesn't work, then any of the default content_taxonomy widgets won't work either. Try if it works with another widget. If it works, tell me, so I can start pulling my hair out.

matthew_ellis24’s picture

it works fine with the select widget......sorry!

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)

ARGH!

You really are the only one with this problem. I can't reproduce this. It must be a combination of circumstances. Please check if you can reproduce it on a fresh Drupal 5 site, with only these modules: CCK, Content Taxonomy, Hierarchical Select, Hierarchical Select Content Taxonomy.

matthew_ellis24’s picture

Do you know of any freehosts that support drupal? Hyperphp supports drupal, but only drupal 6.

I must admit though - it's very tempting to delete the whole lot and start from scratch!

wim leers’s picture

Eh, if a host supports Drupal 6, it also supports Drupal 5.

matthew_ellis24’s picture

good point, I feel stupid

matthew_ellis24’s picture

Hmmm, I can't get drupal 5 installed on a number of different freehosts because of database restrictions (no lock privileges) or .htacces/php.ini restrictions. I've commented out the code associated with:

TRICKY: this piece of utterly u2gly, crappy and dysfunctional code is here thanks to the ugly internal works of the content_taxonomy module that don't make any sense at all. It's necessary to support the 'both' (and 'cck') "save option" of content_taxonomy. 

And although this causes it to display the parent item of the HS hierarchy AND the term I select using content taxonomy for another vocab I hope to horribly get around it by putting a space character after the parent terms in the HS lineage, exploding the view variable using a space delimiter and using only the last variable. I know it's horrific but I don't see how else to do it! The problem seems to be with the [view] bit of the string as the tags are output correctly

wim leers’s picture

Eh, [view]? That's token stuff?

matthew_ellis24’s picture

no no, I mean this bit

$node->field_taxonomy[0]['view']

if your print_r the whole field_taxonomy and field_author arrays then they all seems fine, except for the ['view'] bit where the highest field_taxonomy term gets added to the field_author term

wim leers’s picture

Status: Postponed (maintainer needs more info) » Fixed

You really must be doing something wrong. I don't have the time to investigate every single setting you configured though.

That, or you've got some very exotic modules/settings/combination of things that cause this problem, … somehow. I'm afraid I can't give you any more support.

matthew_ellis24’s picture

thanks, you've been very helpful, sorry to have been such a nuisance!!! Hopefully I'll get it working sometime soon

matthew_ellis24’s picture

yay! Finally figured it out!!!

The module is not automatically selecting "Multiple Values" when you "Save Entire lineage". To get around it you have to change the widget to something simple like select, save the settings, open it again, select multiple values and at the same time change the widget to hierarchical select. That way it remembers to keep the multiple values option and works perfectly.

wim leers’s picture

Title: Selected terms in a Content Taxonomy field not being saved. » HS Content Taxonomy: "Multiple values" field setting not set when HS configured to "Save entire lineage"
Category: support » bug
Status: Fixed » Active

That sounds like a bug!

wim leers’s picture

Title: HS Content Taxonomy: "Multiple values" field setting not set when HS configured to "Save entire lineage" » HS Content Taxonomy: "Multiple values" field setting not set when save_lineage or the dropbox are enabled
Status: Active » Fixed

Fixed. I was setting #value, which can't be overridden by $form_values. Tiny thing with big consequences.

I had added this line, thinking that it'd be an extra measure to prevent the user from altering the value with a self-written POST. Of course pretty much useless, but I didn't see this coming either.

Thank you very much for your persistence, and I'm glad this is fixed! :)

See http://drupal.org/cvs?commit=125711.

matthew_ellis24’s picture

I'm glad it wasn't just me being stupid. Admittedly it played a bit part, but it wasn't entirely due to it!

summit’s picture

Hi Wim,

I installed the 3.* dev version of 7th july.
I got the same error:

warning: Illegal offset type in /public_html/modules/hierarchical_select/modules/hs_content_taxonomy.module on line 293. 

Could the #value be set somewhere else also?

Sorry to have to report this.
I open this issue again, if it's ok with you.

Thanks for going into this!
greetings,
Martijn

wim leers’s picture

There's nothing I can do about that. That's a line of code that's been taken from the Content Taxonomy Options module. It's possible that you get this error if you have changed the save option from "tag" to "both" though!

summit’s picture

Ok, sorry
I thought because it was also given here on #31 by matthiew it was necessary to report.
I didn't change from tag to both, I only altered a allready available node with 2 content_taxonomy HS fields.
thanks for all your support Wim, but how do you advise to go further with this bug, issue queue content_taxonomy?
greetings,
Martijn

Anonymous’s picture

Status: Fixed » Closed (fixed)

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