Using the Subdomain module on D 7.
Using an existing taxonomy inTaxonomy mode.
When adding taxonomy terms to *any* vocabulary I get error:
Fatal error: Cannot use object of type stdClass as array in /<path-to-Drupal/sites/all/modules/subdomain/includes/subdomain_mode_term.inc on line 53
After searching for similar errors I changed line 53
from: if ($form['#vocabulary']['vid'] == variable_get('subdomain_vocab', 0)
to: if ($form['#vocabulary']->vid == variable_get('subdomain_vocab', 0)
I'm unskilled in PHP. The form is an object?
This allows me to add terms to the vocabularies that are *not* associated with the Subdomains module.
Now when I add a term to the specific vocabulary used with Subdomains taxonomy mode, I get a notice from the second part of the condition on the next line:
Notice: Undefined index: delete in subdomain_mode_term->entry_form_alter() (line 54 of /<path-to-Drupal>/sites/all/modules/subdomain/includes/subdomain_mode_term.inc).
Line 54: && !($form['delete']['#type'] == 'value' && $form['delete']['#value'] == TRUE)) {
I've found the 'isset' function, but the meaning and logic of this condition is confusing me.
I've added a line between 53 and 54 as follows:
&& isset($form['delete'])
This removes the notice, but I'm relying on this being evaluated left to right and I guess this is probably incorrect.
Perhaps someone could improve on this?
Comments
Comment #1
tebb commentedI tried some more adding and deleting terms in a Vocabulary and had to make some more changes similar to #1, but I'm stuck on line 78.
Not sure what's an object or how to find out yet.
Recoverable fatal error: Object of class subdomain_mode_term could not be converted to string in subdomain_mode_term->save() (line 78 of /<path>/sites/all/modules/subdomain/includes/subdomain_mode_term.inc).Does anyone have Subdomains working on D7 in Taxonomy mode?
Is this something specific to my site?
Comment #2
akalata commentedI'm getting the same error. I was able to get it working with a clean install and only one taxonomy vocabulary and item (since subdomain by node type isn't working yet, I created a taxonomy with a single term for "blog") -- but now I can't add additional taxonomy items.
Comment #3
artatac commentedsame - sub
Comment #4
turing79it commented+1
Comment #5
rwohlebThis should be fixed in the latest commit (c8def26). Download a new copy of 7.x-2.x and give it a test.
Comment #6
salientknight commentedUpdated, cleared cache still getting the error
Notice: Undefined index: delete in subdomain_mode_term->entry_form_alter() (line 53 of /var/www/mysite/html/sites/all/modules/subdomain/includes/subdomain_mode_term.inc).
Comment #7
Nigeria commentedGot the same error here except that I could not edit ANY content types until I disabled the module
Comment #8
sensifreak commentedSame Problem *PUSH*
Comment #9
netikseo commentedThe same error with the version 7.x-2.0-beta2:
Notice: Undefined index: delete in subdomain_mode_term->entry_form_alter() (line 53 of /path-to-Drupal/sites/all/modules/subdomain/includes/subdomain_mode_term.inc).
Comment #10
inventlogic commentedGetting the same error. I think the variable has been passed as an array instead of a pointer to a single variable value.
I changed lines 81 and 82 in subdomain_mode_term.inc to the following:
I was able to delete a term from the vocabulary after this change but can anyone else using this change test it and post any problems.
Comment #11
bartezz commentedAlso error on line #102 of subdomain.inc (Cannot use object of type stdClass as array) using dev version I just downloaded now...
Changed
$subdomain = subdomain_get_subdomain($object['uid']);
To
$subdomain = subdomain_get_subdomain($object->uid);
Cheers
Comment #12
honza pobořil commented