This is definitely an issue.
But patch #2 works only if you need to remove 1 element.
removeItem() function reassign deltas and for the next elements it wonβt work.
The solution should be similar to the jsonapi module from Core:
- Collect deltas to remove
- Remove them in the desc order.
I tested with the multiple field reference to the paragraphs.
I have 3 paragraphs with 2 unpublished:
$items = [
0 => 'paragraph-0-unpublished',
1 => 'paragraph-1',
2 => 'paragraph-2-unpublished',
];
Unpublished paragraphs are not shown in the $elements after viewElements() and should be removed from the $items
$elements = [
1 => 'paragraph-1',
];
Created MR and added a patch.
vselivanov β made their first commit to this issueβs fork.
Thank you!
I use S3FS external file system and have the same issue with Chosen 4.0.2 and Drupal 10.3.2.
Patch works.
pameeela β credited vselivanov β .
I rerolled patch #48 for Admin Toolbar 3.5.0 on Drupal 10.3.1
Thanks @jan! Patch #7 with this fix works for me.
I also had related 500 PHP errors when visiting views page:
TypeError: htmlspecialchars(): Argument #1 ($string) must be of type string, __PHP_Incomplete_Class given in htmlspecialchars() (line 437 of /var/www/cmds/docroot/core/lib/Drupal/Component/Utility/Html.php).
#0 /var/www/cmds/docroot/core/lib/Drupal/Component/Utility/Html.php(437): htmlspecialchars()
#1 /var/www/cmds/docroot/core/lib/Drupal/Component/Render/FormattableMarkup.php(268): Drupal\Component\Utility\Html::escape()
#2 /var/www/cmds/docroot/core/lib/Drupal/Component/Render/FormattableMarkup.php(217): Drupal\Component\Render\FormattableMarkup::placeholderEscape()
#3 /var/www/cmds/docroot/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php(195): Drupal\Component\Render\FormattableMarkup::placeholderFormat()
#4 /var/www/cmds/docroot/core/lib/Drupal/Component/Utility/ToStringTrait.php(15): Drupal\Core\StringTranslation\TranslatableMarkup->render()
#5 /var/www/cmds/docroot/core/modules/views_ui/src/ViewEditForm.php(1148): Drupal\Core\StringTranslation\TranslatableMarkup->__toString()
#6 /var/www/cmds/docroot/core/modules/views_ui/src/ViewEditForm.php(622): Drupal\views_ui\ViewEditForm->getFormBucket()
And this one:
Error: Object of class __PHP_Incomplete_Class could not be converted to string in Drupal\views\Plugin\views\relationship\RelationshipPluginBase->defineOptions() (line 97 of /var/www/cmds/docroot/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php)
#0 /var/www/cmds/docroot/core/modules/views/src/Plugin/views/PluginBase.php(143): Drupal\views\Plugin\views\relationship\RelationshipPluginBase->defineOptions()
#1 /var/www/cmds/docroot/core/modules/views/src/Plugin/views/HandlerBase.php(109): Drupal\views\Plugin\views\PluginBase->init()
#2 /var/www/cmds/docroot/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php(67): Drupal\views\Plugin\views\HandlerBase->init()
Thank you for this quick update.
Quiz dev-6.0.x works for me with Drupal 10.3.1.
I removed all my composer repository changes from the #5 of Closed #3463528: cannot install 6.0.0-alpha8 on drupal 10.3.1.
Now composer update pulls Rules 4.0.0.
smustgrave β credited vselivanov β .
Hi @sarwan_verma,
I don't think it's possible to solve this with a patch for a usual composer based Drupal setup. Composer checks requirements for all children at the very beginning.
The issue here is that Rules module has a separate
4.0.x-dev β
branch for Drupal 10.3+.
I added it to the Quiz composer.json.
Also we have an issue to remove Rules dependency https://www.drupal.org/project/quiz/issues/3220608 β¨ Move rules integration into a sub module Active But it's not ready as for now.
For Drupal 10.3+ in the main composer.json you could use:
1. Exclude quiz from the main repository and add this issue fork for it in the repositories section:
"repositories": [
{
"type": "git",
"url": "https://git.drupalcode.org/issue/quiz-3463528.git"
},
{
"type": "composer",
"url": "https://packages.drupal.org/8",
"exclude": [
"drupal/quiz"
]
},
],
2. Use the branch from this issue and fork in the require section:
"require": {
"drupal/quiz": "dev-3463528-cannot-install-6.0.0-alpha8",
},
vselivanov β made their first commit to this issueβs fork.
Hi!
I updated MR 24 with the latest code from 2.0.x: 542125c commit Issue #3428127 by deepakkm, ankitv18, Berdir: Automated Drupal 11 compatibility fixes for default_content
vselivanov β made their first commit to this issueβs fork.
Hi!
Have the same error. It happens because shield middleware do it's job before modules are loaded. It calls authenticate and flood whitelist checks, but there is no flood_control_get_whitelist_ips() function yet.
This patch to the shield module helped me:
https://www.drupal.org/project/shield/issues/3277210#comment-15104934
π
Shield middleware invokes hooks before modules are loaded, corrupting module_implements cache
Needs work
I have this issue with cloning custom entity and fixed it with MR 53 and custom code.
With entity_clone 2.0.0-beta6 we have isClonable() method in src/EntityCloneClonableField.php which also checks
$field_definition instanceof FieldConfigInterface
But all custom reference fields are instance of BaseFieldDefinition class.
So we need additional changes to this method.
I tried to remove this FieldConfigInterface check, but it adds a lot of not needed fields and caused recursions and "Circular reference detected" errors.
Finally I managed to clone custom entities with:
1. Apply patch from the MR 53 (attached it)
2. Extend EntityCloneClonableField class in the custom module and add hardcoded custom entity types check.
Example with 2 files:
1. File modules/custom/my_module/src/MyModuleServiceProvider.php
<?php
namespace Drupal\my_module;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;
/**
* Overrides EntityCloneClonableField class.
*/
class MyModuleServiceProvider extends ServiceProviderBase {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
if ($container->hasDefinition('entity_clone.clonable_field')) {
/** @var \Symfony\Component\DependencyInjection\Definition $definition */
$definition = $container->getDefinition('entity_clone.clonable_field');
$definition->setClass('Drupal\my_module\EntityCloneClonableField');
}
}
}
2. File modules/custom/my_module/src/EntityCloneClonableField.php
<?php
namespace Drupal\my_module;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Field\EntityReferenceFieldItemListInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\entity_clone\EntityCloneClonableField as EntityCloneClonableFieldSource;
/**
* Manage entity clone clonable field.
*/
class EntityCloneClonableField extends EntityCloneClonableFieldSource {
/**
* {@inheritDoc}
*/
public function isClonable(FieldDefinitionInterface $field_definition, FieldItemListInterface $field): bool {
$isClonable = parent::isClonable($field_definition, $field);
// Add custom entities fields as clonable.
$customClonableEntityTypes = [
'custom_entity_1',
'custom_entity_2',
];
if (!$isClonable && in_array($field_definition->getTargetEntityTypeId(), $customClonableEntityTypes)
&& $field_definition instanceof BaseFieldDefinition
&& $field instanceof EntityReferenceFieldItemListInterface && $field->count() > 0) {
return TRUE;
}
return $isClonable;
}
}
Patch #126 doesn't work for me with the recent Drupal 10.2.6.
We used it previously, but now we found a bug with Media Library widget.
Steps to reproduce:
1. With applied patch #126 go to the node edit page with Image field, open popup with Media Library widget.
2. In the view with existing images below the upload area go to the 2nd page (with ajax pager)
3. Select image and click Insert selected.
4. You get an Ajax error in console.
With Drupal 10.2.6 I applied the patch #116, but without tests (sorry for that).
I don't think this is the right approach because of hardcoded view id:
$this->id() !== 'media_library'
But it works good for me as a hotfix.
Updated patch includes all fixes above.
Created MR and attached patch. Also tested with ctools 4.0.4.
vselivanov β created an issue.
I re-tested #7-9 with fresh install and had error for not enabled term_reference_change module dependency:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The service "term_merge.term_merger" has a dependency on a non-existent service "term_reference_change.migrator".
Fixed, updated MR and created this patch.
Yes, just worked with the same fix.
Tested and looks good for me with taxonomy_manager 2.0.10 and Drupal 10.2.5
Solution depends on the pipeline. hook update works for me with such deploy:
1. composer install
2. drush updb -y
3. drush cim -y
4. drush cr
Note, that on local I run drush updb with this patch and exported configs with enabled term_merge module.
vselivanov β made their first commit to this issueβs fork.
I had exactly the same issue with scroll and patch #5 fixed it.
Thank you, @gouthamraon!
I had this issue with undefined and also similar with null with Drupal 10.1.5.
Added null check to the patch #2 and created MR.
But we still need a tests.
Created MR. Please, review.
vselivanov β created an issue.
+ The war is not over. We need community support
vselivanov β made their first commit to this issueβs fork.
Hi @s_leu!
Thank you for work with this warnings.
But we should create a merge request to 2.x branch - not 8.x-1.x.
So we need only this commit
Only from this commit I created a patch that works good with the latest Drupal 10.1.5, CKEditor5 and Editor Advanced Link 2.2.4 release.
Hi!
Thank you @ankur.
I also use only this opigno_scorm module and prefer to not have additional dependencies.
@axelm Could we just copy these traits from opigno_module to the current module?
If it's ok I'll create a merge request.
vselivanov β created an issue.
fgm, thank you for the patch.
It fixed 2 warnings on the node edit page with Drupal 9.5.9.
It's hard to define the reason of these warnings. Site uses a lot of contrib modules and custom alterations. Even on this node edit page.
One of them because of token replacements:
Deprecated function: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Core\Controller\TitleResolver->getTitle() (line 60 of /var/www/docroot/core/lib/Drupal/Core/Controller/TitleResolver.php)
#0 /var/www/docroot/core/includes/bootstrap.inc(347): _drupal_error_handler_real(8192, 'strlen(): Passi...', '/var/www/docroo...', 60)
#1 [internal function]: _drupal_error_handler(8192, 'strlen(): Passi...', '/var/www/docroo...', 60)
#2 /var/www/docroot/core/lib/Drupal/Core/Controller/TitleResolver.php(60): strlen(NULL)
#3 /var/www/docroot/modules/contrib/token/token.tokens.inc(843): Drupal\Core\Controller\TitleResolver->getTitle(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\Routing\Route))
#4 [internal function]: token_tokens('current-page', Array, Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#5 /var/www/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array(Object(Closure), Array)
#6 /var/www/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'token')
#7 /var/www/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith('tokens', Object(Closure))
#8 /var/www/docroot/core/lib/Drupal/Core/Utility/Token.php(359): Drupal\Core\Extension\ModuleHandler->invokeAll('tokens', Array)
#9 /var/www/docroot/core/lib/Drupal/Core/Utility/Token.php(241): Drupal\Core\Utility\Token->generate('current-page', Array, Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#10 /var/www/docroot/core/lib/Drupal/Core/Utility/Token.php(191): Drupal\Core\Utility\Token->doReplace(true, '[current-page:t...', Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#11 /var/www/docroot/modules/contrib/metatag/src/MetatagToken.php(66): Drupal\Core\Utility\Token->replace('[current-page:t...', Array, Array, NULL)
#12 /var/www/docroot/modules/contrib/metatag/src/MetatagManager.php(771): Drupal\metatag\MetatagToken->replace('[current-page:t...', Array, Array)
#13 /var/www/docroot/modules/contrib/metatag/src/MetatagManager.php(617): Drupal\metatag\MetatagManager->processTagValue(Object(Drupal\metatag\Plugin\metatag\Tag\Title), Array, Array, false, 'en')
#14 /var/www/docroot/modules/contrib/metatag/src/MetatagManager.php(549): Drupal\metatag\MetatagManager->generateRawElements(Array, NULL)
#15 /var/www/docroot/modules/contrib/metatag/metatag.module(521): Drupal\metatag\MetatagManager->generateElements(Array, NULL)
#16 /var/www/docroot/modules/contrib/metatag/metatag.module(130): metatag_get_tags_from_route()
#17 /var/www/docroot/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(315): metatag_page_attachments(Array)
#18 /var/www/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}(Object(Closure), 'metatag')
#19 /var/www/docroot/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(316): Drupal\Core\Extension\ModuleHandler->invokeAllWith('page_attachment...', Object(Closure))
#20 /var/www/docroot/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(289): Drupal\Core\Render\MainContent\HtmlRenderer->invokePageAttachmentHooks(Array)
#21 /var/www/docroot/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#22 /var/www/docroot/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(290): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#23 /var/www/docroot/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(132): Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
Thank you sebasgd!
I have the same issue and patch #2 fixed it.
Tested with Facets 2.0.6 and Drupal 9.5.8.
Looks like it appeared after 2.0.6 release with this issue fixed
https://www.drupal.org/project/facets/issues/3210353 β
Rerolled #40 for the v3.3.1 - 3.x-dev 50ff7eb6 commit. Tested with Drupal 9.5.8.
vselivanov β created an issue.
Yes, it's not in the 5.1.9 release. Need to apply patch.
vselivanov β created an issue.