Ctools cause an issue

Created on 19 April 2023, over 1 year ago
Updated 12 June 2023, over 1 year ago

Problem/Motivation

I have spent couple of hours to find out that the latest version (4.0.3 or 8.x-3.13) of Chaos Tool Suite (ctools) module has any conflict with this Asset Injector module.

When you update ctools, Asset injector will lose its conditions. Conditions will be still enabled until it is re-saved again, but conditions are unchecked from some weird reason. When I use my backup - the older version of ctools everything works fine.

Find attached picture for better understanding. Logs are clean.

Does anyone else has experienced the same issue?

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia coaston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @coaston
  • πŸ‡¦πŸ‡ΉAustria maxilein

    Maybe it has to do with this.
    (D 10.0.9) with Ctools 4.0.4

    Accessing: /admin/config/development/asset-injector/css gives

    The website encountered an unexpected error. Please try again later.
    
    Drupal\Component\Plugin\Exception\PluginNotFoundException: The "node_type" plugin does not exist. Valid plugin IDs for Drupal\Core\Condition\ConditionManager are: language, request_path, current_theme, user_role, entity_bundle:block_content, entity_bundle:comment, entity_bundle:contact_message, entity_bundle:feeds_feed, entity_bundle:flagging, entity_bundle:media, entity_bundle:node, entity_bundle:shortcut, entity_bundle:taxonomy_term, entity_bundle:menu_link_content in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
    
    Drupal\Core\Plugin\DefaultPluginManager->getDefinition() (Line: 16)
    Drupal\Core\Plugin\Factory\ContainerFactory->createInstance() (Line: 59)
    Drupal\Core\Condition\ConditionManager->createInstance() (Line: 81)
    Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin() (Line: 80)
    Drupal\Component\Plugin\LazyPluginCollection->get() (Line: 26)
    Drupal\Core\Condition\ConditionPluginCollection->get() (Line: 149)
    Drupal\Component\Plugin\LazyPluginCollection->getIterator() (Line: 62)
    Drupal\asset_injector\AssetInjectorListBuilder->buildRow() (Line: 219)
    Drupal\Core\Entity\EntityListBuilder->render() (Line: 23)
    Drupal\Core\Entity\Controller\EntityListController->listing()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 74)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 686)
    Drupal\Core\DrupalKernel->handle() (Line: 19)
    
    

    In asset_injector\src\Form\AssetInjectorFormBase.php lines 243 - 248:

        // Modify the titles of the node_type plugin & hide negate.
        if (isset($form['node_type'])) {
          $form['node_type']['#title'] = $this->t('Content types');
          $form['node_type']['bundles']['#title'] = $this->t('Content types');
          $form['node_type']['negate']['#type'] = 'hidden';
          $form['node_type']['negate']['#value'] = $form['node_type']['negate']['#default_value'];
        }

    Maybe this can help: https://www.drupal.org/project/drupal/issues/3356728#comment-15049010 πŸ’¬ The "node_type" plugin does not exist - upgrade from D9 to D10 Closed: cannot reproduce

  • πŸ‡¦πŸ‡ΉAustria maxilein

    It makes the module unconfigurable...

  • πŸ‡¦πŸ‡ΉAustria maxilein

    Seems to have been left overs. I cannot find the root of the problem.
    Here is the quick fix:

    1. Save all *.css files from \sites\default\files\asset_injector\css
    2. uninstalled asset_injector.
    3. merged all *css files from 1. using cmd
    COPY ".\styles\*.css" ".\style.merged.css"
    4. installed asset_injector
    5. created a new css asset where I pasted all the merged styles.

Production build 0.71.5 2024