As a temporary fix to this issue I altered the database with the following query:
ALTER TABLE `groups_field_data` MODIFY `revision_id` int(10) unsigned NOT NULL DEFAULT 0, MODIFY `status` tinyint(4) NOT NULL DEFAULT 0, MODIFY `revision_translation_affected` tinyint(4) DEFAULT 0;
This allows me to create the training, and does not seem to have negative side effects at this time.
I have the same problem but with the groups_field_data table:
I spun up an older version of Opigno, and Drupal:
DRUPAL VERSION
9.4.15
MEMORY LIMIT
256M
DATABASE VERSION
10.4.25-MariaDB-log
PHP
7.4.30
Opigno LMS VERSION
3.0.9
database schema difference
CREATE TABLE `groups_field_data` ( `id` int(10) unsigned NOT NULL, `type` varchar(32) CHARACTER SET ascii NOT NULL COMMENT 'The ID of the target entity.', `langcode` varchar(12) CHARACTER SET ascii NOT NULL, `uid` int(10) unsigned NOT NULL COMMENT 'The ID of the target entity.', `label` varchar(255) DEFAULT NULL, `created` int(11) DEFAULT NULL, `changed` int(11) DEFAULT NULL, `default_langcode` tinyint(4) NOT NULL, PRIMARY KEY (`id`,`langcode`), KEY `group__id__default_langcode__langcode` (`id`,`default_langcode`,`langcode`), KEY `group_field__type__target_id` (`type`), KEY `group_field__uid__target_id` (`uid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='The data table for group entities.';
It seems to me that the following columns were added:
- revision_id: An integer column that might be used to store information related to revisions of the entity.
- status: A tiny integer column that might be used to store the status of the entity.
- revision_translation_affected: A tiny integer column that might be used to indicate whether a revision has affected translations.
mtaggart@s-5.com → created an issue.
I resolved my issue:
Diving into the code for the errors I added logs for the following code as mentioned in the error (Drupal\rules\Plugin\RulesExpression\ConditionExpression->processData(Object, Object) (Line: 83));
Relative path to file: web/modules/contrib/rules/src/Context/ContextHandlerTrait.php
I found that I were I was hitting two rules I had set up. I decided to delete the 2 previous rules I had made, and remake them. This actually solved this error. I am not sure if the patches (found here: https://www.drupal.org/project/rules/issues/3285721#comment-15186484 ✨ Unable to get variable 'user' Needs review && https://www.drupal.org/project/drupal/issues/3294680 🐛 PHP8.1 deprecation: str_replace(): Passing null to parameter #3 Needs work ) are also contributing in some way to the making new rules and deleting the old ones.
I have a Drupal 9 website with an Opigno distribution. Opigno uses Aristotle as their base theme. I created a subtheme called s_5_university that is the default for the website. This unfortunately messes with the Color module that Opigno requires for some of their functionality. We get the following error:
Warning: Trying to access array offset on value of type null in Drupal\color\ColorThemeDecorator->getPalette() (line 413 of modules/contrib/color/src/ColorThemeDecorator.php).This is because the getPalette function is passed the s_5_university value for the argument $theme here:
public function getPalette($theme, $default = FALSE) {And immediately tries to pass that value to the function color_get_info() here:
$info = color_get_info($theme);The color_get_info looks like the following:
/**
* Retrieves the Color module information for a particular theme.
*/
function color_get_info($theme) {
static $theme_info = [];if (isset($theme_info[$theme])) {
return $theme_info[$theme];
}$path = \Drupal::service('extension.list.theme')->getPath($theme);
$file = \Drupal::root() . '/' . $path . '/color/color.inc';
if ($path && file_exists($file)) {
include $file;
// Add in default values.
$info += [
// CSS files (excluding @import) to rewrite with new color scheme.
'css' => [],
// Files to copy.
'copy' => [],
// Gradient definitions.
'gradients' => [],
// Color areas to fill (x, y, width, height).
'fill' => [],
// Coordinates of all the theme slices (x, y, width, height) with their
// filename as used in the stylesheet.
'slices' => [],
// Reference color used for blending.
'blend_target' => '#ffffff',
];
$theme_info[$theme] = $info;
return $info;
}
}Now I haven't set up any Color module information for my theme s_5_university, and I am not sure exactly what I need to create to feed this function what it needs. It is likely encountering this error because I have no Color module information set up for it to read at this time.
Resolved
The color_get_info() function is looking for for a color directory with the color.inc file.
- In the subtheme directory create a directory called "color".
- In the subtheme directory go into the new directory "color" and create a file named "color.inc"
- In the subtheme directory go into the new directory "color" and create a file named "color.css"
- For reference of how these files should look, you can go to /themes/contrib/aristotle/color
This completely resolved my issue as now the color_get_info() function can access the information it is requesting.
Created a patch for 8.x-3.0-alpha7 with the changes suggested by TR in Comment #10. https://www.drupal.org/project/rules/issues/3285721#comment-14574248 ✨ Unable to get variable 'user' Needs review
I believe the Rules module is the reason I am getting this error as well see the details here: https://www.drupal.org/project/rules/issues/3285721#comment-15186484 ✨ Unable to get variable 'user' Needs review ;
Because a patch was not available there I was able to resolve the issue by adding the patch marcoscano provided in comment #2 ( https://www.drupal.org/project/drupal/issues/3294680#comment-14597409 🐛 PHP8.1 deprecation: str_replace(): Passing null to parameter #3 Needs work )
Updated my website with the following changes:
Drupal Version
9.4.x => 9.5.10
PHP Version
8.0 => 8.1.14
Version of Drupal Rules:
"drupal/rules": "^3.0@alpha",
After patching the iterator error: https://www.drupal.org/project/rules/issues/3243962 📌 Prepare for PHP 8.1 Fixed
I received the next following error:
Deprecated function: preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated in Drupal\typed_data\PlaceholderResolver->scan() (line 185 of modules/contrib/typed_data/src/PlaceholderResolver.php).
Drupal\typed_data\PlaceholderResolver->scan(NULL) (Line: 63)
Drupal\rules\Plugin\RulesDataProcessor\TokenProcessor->process(NULL, Object) (Line: 320)
Drupal\rules\Plugin\RulesExpression\ConditionExpression->processValue(NULL, Array, Object) (Line: 297)
Drupal\rules\Plugin\RulesExpression\ConditionExpression->processData(Object, Object) (Line: 83)
Drupal\rules\Plugin\RulesExpression\ConditionExpression->prepareContext(Object, Object) (Line: 119)
Drupal\rules\Plugin\RulesExpression\ConditionExpression->executeWithState(Object) (Line: 38)
Drupal\rules\Plugin\RulesExpression\AndExpression->evaluate(Object) (Line: 79)
Drupal\rules\Engine\ConditionExpressionContainer->executeWithState(Object) (Line: 112)
Drupal\rules\Plugin\RulesExpression\RuleExpression->executeWithState(Object) (Line: 33)
Drupal\rules\Plugin\RulesExpression\ActionSetExpression->executeWithState(Object) (Line: 147)
Drupal\rules\EventSubscriber\GenericEventSubscriber->onRulesEvent(Object, 'rules_user_login', Object)
call_user_func(Array, Object, 'rules_user_login', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, Object) (Line: 102)
rules_user_login(Object)
call_user_func_array(Object, Array) (Line: 426)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'rules') (Line: 405)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('user_login', Object) (Line: 433)
Drupal\Core\Extension\ModuleHandler->invokeAll('user_login', Array) (Line: 476)
user_login_finalize(Object) (Line: 171)
Drupal\user\Form\UserLoginForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('user_login_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
There is discussion to protect the Drupal core from this error here: https://www.drupal.org/project/drupal/issues/3294680 🐛 PHP8.1 deprecation: str_replace(): Passing null to parameter #3 Needs work
But the concensus here seems to be that individual modules are likely the cause of these errors, but even so the core should have some protections against these module errors.
When attempting to add the patch I discovered that changing my version to
"drupal/rules": "3.x-dev",
allows the patch, but then it breaks the patch for the iterator error: https://www.drupal.org/project/rules/issues/3243962 📌 Prepare for PHP 8.1 Fixed and vice versa.
I have the same exact bug with a quiz when updating Opigno from 3.0.9 to 3.1.0.
The error occurred specifically on a Drag Text question:
This was resolved with the patch provided in comment #12 by Berdir. I did not try any other patches.
Encountering Error with Opigno Statistics Module Version 3.1.0 Due to Color Module Dependency
Hello,
I am currently using the Opigno Statistics module version 3.1.0 in my Drupal 9 setup with an Opigno distribution. I have encountered the following error:
Warning: Trying to access array offset on value of type null in Drupal\color\ColorThemeDecorator->getPalette() (line 411 of modules/contrib/color/src/ColorThemeDecorator.php).
The issue seems to be related to the Color module, which is required by the Opigno distribution but not actively used in my theme (s_5_university). I am using a CSS file to manually color my website. (I believe I am using something that is referred to as subtheming)
I created a color settings file (s_5_university.settings.yml
) for my theme, specifying some default colors, and declared support for the Color module in my theme's .info.yml
file. However, this did not resolve the issue, and the error persists.
I understand that there is a patch under review for this issue. I would greatly appreciate it if you could expedite the review process, or suggest any other workaround that could help me resolve this issue.
Thank you for your assistance.
I realize that the issue I was experiencing was due to a custom module I had built and did not have anything to do with Opigno's functionality.
mtaggart@s-5.com → created an issue.
I am unsure if this is the same issue or if this unrelated. I encountered the following issues while also upgrading from 3.0.9 to 3.1.0. I am fairly new to Drupal and PHP and I hope that what I am sharing here is relevant. If there is a better way for me to structure the information please let me know so I can contribute for efficiently:
When a user attempts to enroll into a training (group) there is no issue:
https://DOMAIN/group/##/join?type=group
When a user attempts to start the training (group) the button does not do anything:
https://DOMAIN/group/##/learning-path/start
However, when entering this route into the URL bar directly we get the following error:
The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\opigno_learning_path\Entity\LPResult::createWithValues() in Drupal\custom_redirect\Controller\CustomLearningPathStepsController->start() (line 41 of modules/custom/custom_redirect/src/Controller/CustomLearningPathStepsController.php).
Drupal\custom_redirect\Controller\CustomLearningPathStepsController->start(Object, 'group')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Here is the php-error.log for the same error:
Error: Call to undefined method Drupal\opigno_learning_path\Entity\LPResult::createWithValues() in /code/web/modules/custom/custom_redirect/src/Controller/CustomLearningPathStepsController.php on line 41 #0 [internal function]: Drupal\custom_redirect\Controller\CustomLearningPathStepsController->start(Object(Drupal\group\Entity\Group), 'group')
#1 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#2 /code/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#3 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#4 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#5 /code/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#6 /code/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#7 /code/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#8 /code/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 /code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 /code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 /code/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /code/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /code/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /code/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /code/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#16 {main}
When existing users attempt to continue a training (group) that they have already been enrolled into:
https://DOMAIN/group/##/learning-path/start/group
The website encountered an unexpected error. Please try again later.
Error: Call to a member function createInstance() on null in Drupal\custom_redirect\Controller\CustomLearningPathStepsController->start() (line 196 of modules/custom/custom_redirect/src/Controller/CustomLearningPathStepsController.php).
Drupal\custom_redirect\Controller\CustomLearningPathStepsController->start(Object, 'group')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Here is the php-error.log for the same issue:
Error: Call to a member function createInstance() on null in /code/web/modules/custom/custom_redirect/src/Controller/CustomLearningPathStepsController.php on line 196 #0 [internal function]: Drupal\custom_redirect\Controller\CustomLearningPathStepsController->start(Object(Drupal\group\Entity\Group), 'group')
#1 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#2 /code/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#3 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#4 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#5 /code/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#6 /code/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#7 /code/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#8 /code/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 /code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 /code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 /code/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /code/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /code/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /code/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /code/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#16 {main}
When existing users attempt to continue a training (group) that they have already been enrolled into by clicking the following button it does not do anything:
https://DOMAIN/group/##/learning-path/start
However, there is a warning I see on the web page:
Warning: Undefined property: Drupal\custom_redirect\Controller\CustomLearningPathStepsController::$content_type_manager in Drupal\custom_redirect\Controller\CustomLearningPathStepsController->start() (line 196 of modules/custom/custom_redirect/src/Controller/CustomLearningPathStepsController.php).
Drupal\custom_redirect\Controller\CustomLearningPathStepsController->start(Object, 'group')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Using "opigno/opigno_lms": "~3.0.9",
I was trying to use "cweagans/composer-patches": "^1.7" and in my composer.json adding the
"opigno/opigno_module": {
"Opigno issue": "
https://www.drupal.org/files/issues/2021-09-20/303561-14.patch →
"
},
But for some reason it didn't apply. I noticed some slight differences in the lines of where the code changes should occur. I decided to try my hand at making my first patch ever, and see if it works!
opigno_module_303561-16.patch
I am also experiencing the same issue:
Drupal 9.4.13
PHP 8.0.27
Version: 2.0.0-alpha3
Using the Opigno distribution, when I go to add a new Question Set OR when I try to load an existing Question Set I get the following Errors in the console:
GET https://libraries/H5PEditor.TableList-1.0/h5p-editor-table-list.css?ver=... net::ERR_NAME_NOT_RESOLVED
GET https://libraries/H5PEditor.RangeList-1.0/h5p-editor-range-list.css?ver=... net::ERR_NAME_NOT_RESOLVED
GET https://libraries/H5PEditor.ShowWhen-1.0/h5p-show-when.css?ver=1.0.9 net::ERR_NAME_NOT_RESOLVED
GET https://libraries/FontAwesome-4.5/h5p-font-awesome.min.css?ver=4.5.4 net::ERR_NAME_NOT_RESOLVED
GET https://libraries/H5PEditor.VerticalTabs-1.3/styles/css/vertical-tabs.cs... net::ERR_NAME_NOT_RESOLVED
GET https://libraries/H5PEditor.QuestionSetTextualEditor-1.3/dist/question-s... net::ERR_NAME_NOT_RESOLVED
The functionality for the call is here:
/modules/contrib/h5p/vendor/h5p/h5p-editor/scripts/h5peditor.js
This is where the code seems to have issues:
ns.libraryRequested = function (libraryName, callback) {
var libraryData = ns.libraryCache[libraryName];
if (!ns.libraryLoaded[libraryName]) {
// Add CSS.
if (libraryData.css !== undefined) {
libraryData.css.forEach(function (path) {
if (!H5P.cssLoaded(path)) {
H5PIntegration.loadedCss.push(path);
if (path) {
ns.$('head').append('<link ' +
'rel="stylesheet" ' +
'href="' + path + '" ' +
'type="text/css" ' +
'/>');
}
}
});
}
// Add JS
var loadingJs = false;
if (libraryData.javascript !== undefined && libraryData.javascript.length) {
libraryData.javascript.forEach(function (path) {
if (!H5P.jsLoaded(path)) {
loadingJs = true;
ns.loadJs(path, function (err) {
if (err) {
console.error('Error while loading script', err);
return;
}
The libraryData.css & libraryData.javascript for me is the following:
[
"//libraries/H5PEditor.TableList-1.0/h5p-editor-table-list.css?ver=1.0.4",
"//libraries/H5PEditor.RangeList-1.0/h5p-editor-range-list.css?ver=1.0.12",
"//libraries/H5PEditor.ShowWhen-1.0/h5p-show-when.css?ver=1.0.9",
"//libraries/FontAwesome-4.5/h5p-font-awesome.min.css?ver=4.5.4",
"//libraries/H5PEditor.VerticalTabs-1.3/styles/css/vertical-tabs.css?ver=1.3.9"
]
[
"//libraries/H5PEditor.QuestionSetTextualEditor-1.3/dist/question-set-textual-editor.js?ver=1.3.8",
"//libraries/H5PEditor.TableList-1.0/h5p-editor-table-list.js?ver=1.0.4",
"//libraries/H5PEditor.RangeList-1.0/h5p-editor-range-list.js?ver=1.0.12",
"//libraries/H5PEditor.ShowWhen-1.0/h5p-show-when.js?ver=1.0.9",
"//libraries/H5PEditor.VerticalTabs-1.3/vertical-tabs.js?ver=1.3.9",
"//libraries/H5P.QuestionSet-1.17/presave.js?ver=1.17.1"
]
1. The libraryData.css.forEach && libraryData.javascript.forEach is looping through each of these index's
2. The function H5P.cssLoaded(path) && H5P.jsLoaded(path) (found in web/modules/contrib/h5p/vendor/h5p/h5p-core/js/h5p.js) determines the position of an element in the array (it would return 0-5, and 0-4 respectfully)
3. The function ns.loadJs (found in web/modules/contrib/h5p/vendor/h5p/h5p-editor/scripts/h5peditor.js) takes in the index we are at in the array, and is creating a new script element.
My Analysis:
I believe the ns.loadJs is where our issue occurs.
I am not sure why.
The ALTER TABLES queries matched with the 3.x patch found here: https://www.drupal.org/project/opigno_module/issues/3035615#comment-1498... ✨ Allow creating activites and modules with longer names Needs review . Fixed this for me great!
The latest 3.x rolled patch combined with the Alter Table's suggested here: https://www.drupal.org/project/opigno_lms/issues/3132158 → . Fixed the problem for me!
Running into the same issue. @firstlut Could you describe how to patch the main.css file to look like the _base.css file? I am unclear on how to do this.
I may have not understood, but this problem would clearly not be an issue with Opigno, and is likely an issue with the my implementation of ddev. Or just my lack of knowledge on the subject in general.