Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have exported (via features) the taxonomy/term/%term page variant I created to handle terms in the "Pet types" vocabulary (machine name pet_types). When I enabled this feature on the live site the vocabulary ID didn't match. The export needs to use machine_name instead of vid. See relevant snippet below:
$handler = new stdClass();
$handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
$handler->api_version = 1;
$handler->name = 'term_view_panel_context';
$handler->task = 'term_view';
$handler->subtask = '';
$handler->handler = 'panel_context';
$handler->weight = -99;
$handler->conf = array(
'title' => 'Pet types',
'no_blocks' => 0,
'pipeline' => 'standard',
'body_classes_to_remove' => '',
'body_classes_to_add' => '',
'css_id' => '',
'css' => '',
'contexts' => array(),
'relationships' => array(),
'access' => array(
'plugins' => array(
0 => array(
'name' => 'term_vocabulary',
'settings' => array(
'vids' => array(
13 => '13',
),
),
'context' => 'argument_term_1',
'not' => FALSE,
),
),
'logic' => 'and',
),
);
Comment | File | Size | Author |
---|---|---|---|
#16 | ctools-vcab-maschine-name-1586324.patch | 4.43 KB | dasRicardo |
#14 | 1586324-11.png | 77.85 KB | R.Hendel |
#11 | ctools-vcab-maschine-name-1586324.patch.patch | 4.37 KB | dasRicardo |
#8 | 1586324-difference-features-source.txt | 2.39 KB | R.Hendel |
#6 | ctools-vcab-maschine-name-1586324.patch | 3.68 KB | dasRicardo |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedOh ugh, we're using vocabulary IDs and not machine names; a failure of the upgrade.
Technically this isn't a bug, I think, but since vocabularies have machine names this really should work this way.
To fix this, we'll have to update the access rule to use machine names instead of vids (and be able to convert vids for existing configs) and automatically fix them when saving the config.
Then when fixed you could re-save the problem handler, export it and it will work.
The workaround until that is done would be to, uh, manually fix your vid on export. Sorry. :/
Comment #2
mstrelan CreditAttribution: mstrelan commentedHere is a start. I've updated the access plugin to use machine names instead of vids. Needs an upgrade script to convert existing variants. Is this used elsewhere and needs updating also?
Comment #3
jwilson3I was actually able to work around my needs for this using the taxonomy term bundle in my selection rules, which does already use the machine name, instead of vid. But, also, I noticed an issue with your patch:
@vids needs to be replaced everywhere in the format_plural call. I've fixed this in the attached patch, but this patch needs more review, since I'm not actually using it and found a workaround.
Comment #4
caschbre CreditAttribution: caschbre commentedThe workaround in #3 to use the taxonomy term bundle seems to have worked for me as well.
Comment #5
guddo CreditAttribution: guddo commentedSince this is not yet reviewed, I just tested it with 7.x-1.3:
Comment #6
dasRicardo CreditAttribution: dasRicardo commentedHello,
I have rewritten the term_vocabulary access plugin to use vocabulary_maschinename instead of vid.
Comment #7
dasRicardo CreditAttribution: dasRicardo commentedComment #8
R.Hendel CreditAttribution: R.Hendel commentedHi,
I patched ctools and tested functionality. Everything works as expected so I think, that everything is fine.
Warning:
After patching ctools it's neccessairy to rebuild your all of your features which uses vocabularies as display conditions!
Attached you'll find a git diff of exported features source after patching compared with unpatched source.
You'll find, that everywhere vids are replaced through machine-readables.
Comment #9
dawehnerJust to be clear, will existing sites still work or have the features to be updated first?
Comment #10
R.Hendel CreditAttribution: R.Hendel commentedAfter patching the system will work in a sense, that there's no whitescreen.
You can access panel-ui and edit all your panels pages as before. The display-conditions are still there, but they have lost connection to former vocabulary.
So you have to reorganize all your panels/features using vocabularies as a display conditions as panels won't understand now "'vids' => array(" like it did before patching. All you have to do is to edit each variants display condition and tell system which vocabulary should be listened on.
So your panels conditions won't work as expected after patching ctools. But the entire system is still running.
Comment #11
dasRicardo CreditAttribution: dasRicardo commentedHello,
after talking with dawehner and R.Hendel, I have rewritten the plugin again to add a helper function that maps the vid from the old features to the new maschine_name value.
Comment #12
dawehnerRalf promised to do another manual test, but I think this is already ready to fly.
Just in case you want to improve stuff: https://drupal.org/node/1354 ... add @param array $conf, and describe that $conf is altered.
Comment #13
damiankloip CreditAttribution: damiankloip commentedmaschine names?
Otherwise, I agree, looks good to fly.
Comment #14
R.Hendel CreditAttribution: R.Hendel commentedWhen testing the patch I found, that
- patched ctools without changing preexisting features leaves page absolutely intact.
- To updated preexisting entrys you have to go into pane-condition and save settings. You don't have to change settings for this. (see attached screenshot)
- After saving panel ctools will export machine-readables instead of vids.
So from my point of view everything works fine. :-)
Comment #15
dawehnerLet's call it denglish
Comment #16
dasRicardo CreditAttribution: dasRicardo commentedHello,
thanks for all your reviews, and sorry for my English :) I fix the issues and think everything is fine now.
Comment #17
dawehnerThanks for all the manual tests, reviews etc.
Committed and pushed to 7.x-1.x
http://drupalcode.org/project/ctools.git/commit/e81da7a
Comment #19
hefox CreditAttribution: hefox commentedComment #20
hessam61 CreditAttribution: hessam61 commentedHello,
I'm experiencing this issue with the latest version of ctools, 7.x-1.4. Any idea?
Comment #21
paskainos CreditAttribution: paskainos commentedI too have recently experienced this issue with version 7.x-1.4.
Comment #22
emmene-moi CreditAttribution: emmene-moi commentedHas been removed from dev and production branches. Someone might have mixed merges.
Please include the patch again or add some kind of justification of this disappeared commit here.
Comment #23
emmene-moi CreditAttribution: emmene-moi commentedSorry, mixed with term_parent. Exists in commit.