No Code Attached Yet bug
avatar coolcat-creations
coolcat-creations
31 Jan 2023

Steps to reproduce the issue

Create an admin menu
Create a menu item and click on menu item type

Expected result

A list of menu item types

Actual result

0 strlen(): Argument #1 ($string) must be of type string, array given

System information (as much as possible)

PHP Version 8.0.27 ==================

0 strlen(): Argument #1 ($string) must be of type string, array given

Call stack
# Function Location
1 () JROOT/administrator/components/com_menus/src/Model/MenutypesModel.php:412
2 strlen()  
3 array_filter() JROOT/administrator/components/com_menus/src/Model/MenutypesModel.php:412
4 Joomla\Component\Menus\Administrator\Model\MenutypesModel->getTypeOptionsFromManifest() JROOT/administrator/components/com_menus/src/Model/MenutypesModel.php:173
5 Joomla\Component\Menus\Administrator\Model\MenutypesModel->getTypeOptionsByComponent() JROOT/administrator/components/com_menus/src/Model/MenutypesModel.php:108

Additional comments

If I comment out Line 412 to 420 in Menu Model it works,
/* $o->request = array_filter($request, 'strlen');
$options[] = new CMSObject($o);

			 // Do not repeat the default view link (index.php?option=com_abc).
			 if (count($o->request) == 1) {
				 $ro = null;
			 }*/

print_r for $request is: print_r for request is:

Array ( [option] => com_banners ) Array ( [option] => com_categories [extension] => com_banners ) Array ( [option] => com_banners [view] => clients ) Array ( [option] => com_banners [view] => tracks ) Array ( [option] => com_contact ) Array ( [option] => com_categories [extension] => com_contact ) Array ( [option] => com_easybookreloaded ) Array ( [option] => com_easybookreloaded [view] => gb ) Array ( [option] => com_easybookreloaded [view] => badwords ) Array ( [option] => com_newsfeeds ) Array ( [option] => com_categories [extension] => com_newsfeeds ) Array ( [option] => com_osmap [act] => [task] => [controller] => [view] => sitemaps [layout] => [sub] => ) Array ( [option] => com_plugins [filter] => Array ( [folder] => osmap ) ) Array ( [option] => com_weblinks ) Array ( [option] => com_categories [extension] => com_weblinks ) Array ( [option] => com_fields [view] => fields [context] => com_weblinks.weblink ) Array ( [option] => com_fields [view] => groups [context] => com_weblinks.weblink )

-- could not be reproduced by others.

Hoster is Ionos

avatar coolcat-creations coolcat-creations - open - 31 Jan 2023
avatar joomla-cms-bot joomla-cms-bot - change - 31 Jan 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 31 Jan 2023
avatar coolcat-creations coolcat-creations - change - 31 Jan 2023
Title
J 4.2.6 - Error Message at creating Menu Item
[4.2.6] - Error Message at creating Admin Menu Item
avatar coolcat-creations coolcat-creations - edited - 31 Jan 2023
avatar coolcat-creations coolcat-creations - change - 31 Jan 2023
Title
[4.2.6] - Error Message at creating Admin Menu Item
[4.2.7] - Error Message at creating Admin Menu Item
avatar coolcat-creations coolcat-creations - edited - 31 Jan 2023
avatar chmst
chmst - comment - 31 Jan 2023

I cannot replicate that. What did you before? Disable the admin menu module?

avatar brianteeman
brianteeman - comment - 31 Jan 2023

Can you replicate this WITHOUT com_easybookreloaded

avatar joomdonation
joomdonation - comment - 31 Jan 2023

Base on data from print_r command, it could come from osmap. I guess in the extension, there is link with this format

option=com_plugins&filter[folder]=osmap

That link could be used to diplay plugins from osmap plugin group. Joomla could not handle that kind of link for some reasons and it causes the error. Sound like a valid bug.

avatar brianteeman
brianteeman - comment - 31 Jan 2023

@joomdonation confirmed

avatar coolcat-creations
coolcat-creations - comment - 31 Jan 2023

Disabled OS Map and I confirm. Should I close the issue and ask OsMap or should Joomla catch such errors different?

avatar carlitorweb
carlitorweb - comment - 31 Jan 2023

Both imo, without close the issue

avatar richard67
richard67 - comment - 31 Jan 2023

Joomlashack have provided an update for their allediaframework library yesterday, which is also used by and provided with OSMap. Maybe that's related?
https://github.com/joomlashack/AllediaFramework/releases/tag/v3.6.6

avatar billtomczak
billtomczak - comment - 2 Feb 2023

@coolcat-creations has been in touch with us. This is a problem we've been aware of for some time but affected only one other user over the years, so we pretty much ignored it.

OSMap contains a link in the sidebar to a list of plugins filtered by OSMap plugins. This is in the component manifest:

<menu link="option=com_plugins&amp;filter[folder]=osmap">COM_OSMAP_SUBMENU_EXTENSIONS</menu>

This breaks code in Joomla for creating admin menus in both Joomla 3 and Joomla 4. The only thing we can do on our end is remove this convenience link. So future versions of OSMap will remove this convenience link.

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023
avatar Hackwar
Hackwar - comment - 5 Aug 2024

This has been reported again in #43715 and there I proposed a fix. I'm unable to create a PR myself right now, but please look at that other issue as well to be kept up to date.

avatar alikon alikon - change - 6 Aug 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-08-06 05:48:17
Closed_By alikon
avatar alikon alikon - close - 6 Aug 2024
avatar alikon
alikon - comment - 6 Aug 2024

please test #43884

Add a Comment

Login with GitHub to post a comment