Skip to content
Snippets Groups Projects
Commit 97caf676 authored by Vladimir Roudakov's avatar Vladimir Roudakov
Browse files

Issue #3299353 by vladimiraus, ressa, project update bot, jannakha: Automated...

Issue #3299353 by vladimiraus, ressa, project update bot, jannakha: Automated Drupal 11 compatibility fixes for Bootstrap 5 tools
parent 05ec2297
Branches 2.1.x
Tags 2.1.0
1 merge request!5Automated drupal 11 fixes
Pipeline #386211 failed
include:
- project: $_GITLAB_TEMPLATES_REPO
ref: $_GITLAB_TEMPLATES_REF
file:
- '/includes/include.drupalci.main.yml'
- '/includes/include.drupalci.variables.yml'
- '/includes/include.drupalci.workflows.yml'
variables:
OPT_IN_TEST_PREVIOUS_MAJOR: 1
OPT_IN_TEST_NEXT_MINOR: 1
OPT_IN_TEST_NEXT_MAJOR: 0
RUN_JOB_UPGRADE_STATUS: 0
cspell:
allow_failure: false
phpcs:
allow_failure: false
phpstan:
allow_failure: false
phpstan (next minor):
allow_failure: false
phpstan (next major):
allow_failure: false
phpunit (previous major):
allow_failure: false
phpunit (next minor):
allow_failure: false
phpunit (next major):
allow_failure: false
upgrade status:
allow_failure: false
...@@ -4,19 +4,48 @@ namespace Drupal\twbstools\Controller; ...@@ -4,19 +4,48 @@ namespace Drupal\twbstools\Controller;
use Drupal\Component\Utility\Html; use Drupal\Component\Utility\Html;
use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\Render\Markup; use Drupal\Core\Render\Markup;
use Drupal\Core\StreamWrapper\PublicStream; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* StyleguideController controller. * StyleguideController controller.
*/ */
class StyleguideController extends ControllerBase { class StyleguideController extends ControllerBase {
/**
* Module extension list.
*
* @var \Drupal\Core\Extension\ModuleExtensionList
*/
protected ModuleExtensionList $extensionListModule;
/**
* Constructs a StyleguideController object.
*
* @param \Drupal\Core\Extension\ModuleExtensionList|null $extension_list_module
* The module extension list.
*/
public function __construct(
protected ?ModuleExtensionList $extension_list_module,
) {
$this->extensionListModule = $extension_list_module;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('extension.list.module'),
);
}
/** /**
* Returns a render-able array for a test page. * Returns a render-able array for a test page.
*/ */
public function render() { public function render() {
$styleguide = file_get_contents(\Drupal::service('extension.list.module')->getPath('twbstools') . '/resources/cheatsheet/index.html'); $styleguide = file_get_contents($this->extensionListModule->getPath('twbstools') . '/resources/cheatsheet/index.html');
$styleguide = str_replace('https://getbootstrap.com/docs/5.1/examples/cheatsheet/', '', $styleguide); $styleguide = str_replace('https://getbootstrap.com/docs/5.1/examples/cheatsheet/', '', $styleguide);
$html_dom = Html::load($styleguide); $html_dom = Html::load($styleguide);
$xpath = new \DOMXPath($html_dom); $xpath = new \DOMXPath($html_dom);
...@@ -47,4 +76,5 @@ class StyleguideController extends ControllerBase { ...@@ -47,4 +76,5 @@ class StyleguideController extends ControllerBase {
], ],
]; ];
} }
} }
name: Bootstrap tools name: Bootstrap tools
type: module type: module
description: 'Companion module for [Bootstrap 5 theme] to provide better content editor and developer experience.' description: 'Companion module for [Bootstrap 5 theme] to provide better content editor and developer experience.'
core_version_requirement: ^9 | ^10 core_version_requirement: ^10.2 || ^11.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment