When we have ctools_custom_content in Page manager, but ctools_custom_content module it results with rebuilding the schema. Patch prevents this by checking this specific case.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amitaibu’s picture

Fix typo.

merlinofchaos’s picture

Can you explain this to me? Is there something I'm missing about this case being special?

amitaibu’s picture

> Is there something I'm missing about this case being special?

*I* might be the one missing ;)

What I've seen is this:
1) I've created a Panels page with some content panes, and ctools_custom_content.
2) Without this patch drupal_get_schema() is reset, resulting with cache::set() updating the cache, that was actually not changed, because ctools_custom_content doesn't have tables.

merlinofchaos’s picture

Yes, ctools_custom_content has tables:


function ctools_custom_content_schema_1() {
  $schema = array();

  $schema['ctools_custom_content'] = array(
    'description' => 'Contains exportable customized content for this site.',
    'export' => array(
      'identifier' => 'content',
      'bulk export' => TRUE,
      'primary key' => 'cid',
      'api' => array(
        'owner' => 'ctools',
        'api' => 'ctools_content',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
      'create callback' => 'ctools_content_type_new',
    ),
    'fields' => array(
      'cid' => array(
amitaibu’s picture

> Yes, ctools_custom_content has tables:

But only when you enable the ctools_custom_content module.

merlinofchaos’s picture

It shouldn't be looking for the schema if that module is not enabled. That would be a bug. :)

merlinofchaos’s picture

Status: Needs review » Needs work

ahh. The custom content type isn't testing if the module is enabled before trying to load its tables. Thats where this should be fixed, not special casing in export.inc

amitaibu’s picture

> Thats where this should be fixed, not special casing in export.inc

Yeah, I knew I found something wrong, but assumed the fix wasn't generic.

> The custom content type isn't testing if the module is enabled before trying to load its tables

Can you give a pointer to where to should be fixed, I didn't find it the first time I went over it.

merlinofchaos’s picture

plugins/content_types/custom/custom.inc -- various calls to ctools_export_crud functions should only be used if the custom content module exists.

amitaibu’s picture

Status: Needs work » Needs review
FileSize
2.14 KB

Finally got back to it :)

merlinofchaos’s picture

Status: Needs review » Fixed

Committed and pushed.

Status: Fixed » Closed (fixed)

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