- Issue created by @interlated
- ๐ฆ๐บAustralia interlated
Still happening
TypeError: Drupal\markdown\PluginManager\InstallablePluginManager::sortDefinitions(): Argument #1 ($definitions) must be of type array, bool given, called in /web/modules/contrib/markdown/src/PluginManager/InstallablePluginManager.php on line 415 in Drupal\markdown\PluginManager\InstallablePluginManager->sortDefinitions() (line 688 of /srv/web/coreprovider.com.au/web/modules/contrib/markdown/src/PluginManager/InstallablePluginManager.php).
- ๐ฆ๐บAustralia interlated
Installing the head branch seems to resolve the issue?
- ๐ฆ๐บAustralia interlated
There are other issues with 8.2
Composer.json, set platform to 8.1
"config": { "platform": { "php": "8.1" },
- ๐ฆ๐บAustralia interlated
The services don't match the interface definition.
- Assigned to RohitRawat676
- Issue was unassigned.
- Status changed to Needs review
about 1 year ago 3:00am 15 November 2023 - last update
about 1 year ago Build Successful - ๐ฆ๐บAustralia interlated
@RohitRawat676 is it safe to remove isset?
- $label = isset($pluginDefinition['label']) ? $pluginDefinition['label'] : $plugin_id;
- $description = isset($pluginDefinition['description']) ? $pluginDefinition['description'] : '';
- $type = isset($pluginDefinition['type']) ? $pluginDefinition['type'] : 'other';
+ $label = $pluginDefinition['label'] ?? $plugin_id;
+ $description = $pluginDefinition['description'] ?? '';
+ $type = $pluginDefinition['type'] ?? 'other';I see that the code has been condensed. I have had problems with white screen and this module.
- Status changed to Needs work
about 1 year ago 12:49am 17 November 2023 - ๐บ๐ธUnited States markdorison
I am all for fixing PHPCS issues, but there are a fair number of changes in patch #7 that are unrelated to the error stated in the issue summary. Please limit changes to those directly related to this issue. Even better, please submit it as a merge request!
- ๐ฎ๐ณIndia chetan 11
chetan 11 โ made their first commit to this issueโs fork.
- last update
about 1 year ago Build Successful - Status changed to Needs review
about 1 year ago 7:43am 20 November 2023 - ๐ฎ๐ณIndia chetan 11
Hi,
I have fixed the given error "TypeError: array_filter()". Please check the MR once.
Thanks. - Status changed to Needs work
about 1 year ago 8:45pm 20 November 2023 - ๐บ๐ธUnited States markdorison
@chetan11 Thank you for creating a merge request, however, the changes in the MR far exceed what is described in the issue description.
- Status changed to Needs review
about 1 year ago 8:27am 21 November 2023 - last update
about 1 year ago Patch Failed to Apply - ๐ฎ๐ณIndia viren18febS
I have updated the condition for blank array & added Patch for solve the issue, please review.
- First commit to issue fork.
- Merge request !28Issue #3401128: Ensure empty array is passed instead of NULL when no definitions are found. โ (Open) created by ankithashetty
- last update
about 1 year ago Build Successful - last update
about 1 year ago Build Successful - last update
about 1 year ago Build Successful - ๐ฎ๐ณIndia ankithashetty Karnataka, India
Hello @markdorison, raised a new MR !28 to avoid confusion with #11 MR as I have a different take on the fix. Please review.
As raised in IS and in #2, #3, we are supposed to get an array (it can be an array with data or even an empty array for that matter) and but not
bool
value.The fix shared in MR !28, ensures that we always return an array in
src/PluginManager/InstallablePluginManager.php
.empty
will work on both cases i.e., ifstatic::$runtimeDefinitions[static::class]
isNULL
or[]
, as there is a possibility thatgetCachedDefinitions
/getDefinitions
may returnNULL
/[]
If there is no value, we make an early return with an empty array.
Also requesting the reporter @interlated to test the MR !28 and see if it resolves the reported errors.
Thanks!