-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin Menu Creation Error - strlen() expects string, array given. #43715
Comments
Multiple installations means three seperate installations. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43715. |
1 - Could you check your database, if there is an error? |
Hi there! Yep, done that. no errors and did a database check and no problems to be found except for perhaps _finder_tokens |
Administrator menu? What do you mean by Could you post a screenshot of the error to show it in context? This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43715. |
@EJBJane The standard links e.g. for the Contact component are added when updating from Joomla 3 (3.10) to 4. If they are missing on some of your sites it could mean that there went something wrong with that. Can you confirm that the sites which have this problem once were updated from Joomla 3? Or were these newer sites created with Joomla 4? |
Okay, so two are sites that started with Joomla 4.0 and another which doesnt have anything else but Components in the admin menu upgraded from 2 to 3 to 4 and now on 5. I confirm I had a problem with some contact links in admin menu after the migration from 4 to 5, some contact links in the admin menu were indeed not showing up. I cant remember what I did to make them reappear, it was a long time ago but it was only on the oldest website I had that problem. |
The problem is this line https://github.com/joomla/joomla-cms/blob/4.4-dev/administrator/components/com_menus/src/Model/MenutypesModel.php#L412 The solution would be to replace the simple reference to strlen here with something like the following:
|
Should I try that myself or wait until there is a patch? |
Just working on a patch but if you want to contribute - would be very appreciated. So I will wait for yor PR :) |
The error should be triggerable with a URL like this in the manifest of a component: |
Same issue #39758 ? |
Yes, indeed. I was actually wondering when you would use such a link, but the OSMap usecase is very valid and we probably will see similar stuff in the future in the core even. |
I will wait. :-) thanks for your work. it is much appreciated. |
please test #43884 |
When attempting to add or edit menu items in the Joomla Administrator backend, an error occurs stating that strlen() expects a string, but an array is given. This issue has been observed in multiple Joomla installations, indicating a possible bug in the core Joomla files related to menu management. It also has the effect of disappearing admin menu items.
Steps to reproduce the issue
Log into the Joomla Administrator Backend: Access the administrator area of a Joomla site.
Navigate to Menus: Go to Menus > Manage and select an administrator menu or try to create a new one.
Attempt to Add or Edit a Menu Item: Click on 'New' to add a new menu item or select an existing item to edit.
Observe the Error: Upon trying to create a new menu item or modify an existing one, an error message is displayed.
Expected result
The user should be able to create a new menu item or edit existing items without encountering errors. The menu item type selection should work seamlessly, allowing administrators to set up and configure backend menus.
Actual result
An error message is displayed, preventing the user from adding or editing menu items. The error details are:
Error Message: 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:414
2 strlen()
3 array_filter() JROOT/administrator/components/com_menus/src/Model/MenutypesModel.php:414
4 Joomla\Component\Menus\Administrator\Model\MenutypesModel->getTypeOptionsFromManifest() JROOT/administrator/components/com_menus/src/Model/MenutypesModel.php:175
5 Joomla\Component\Menus\Administrator\Model\MenutypesModel->getTypeOptionsByComponent() JROOT/administrator/components/com_menus/src/Model/MenutypesModel.php:109
6 Joomla\Component\Menus\Administrator\Model\MenutypesModel->getTypeOptions() JROOT/libraries/src/MVC/View/AbstractView.php:159
7 Joomla\CMS\MVC\View\AbstractView->get() JROOT/administrator/components/com_menus/src/View/Menutypes/HtmlView.php:62
8 Joomla\Component\Menus\Administrator\View\Menutypes\HtmlView->display() JROOT/libraries/src/MVC/Controller/BaseController.php:697
9 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/administrator/components/com_menus/src/Controller/DisplayController.php:74
10 Joomla\Component\Menus\Administrator\Controller\DisplayController->display() JROOT/libraries/src/MVC/Controller/BaseController.php:730
11 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143
12 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
13 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:150
14 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:195
15 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:306
16 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:58
17 require_once() JROOT/administrator/index.php:32
System information (as much as possible)
System Information
Setting Value
PHP Built On Linux dedi2762.your-server.de 5.10.0-29-amd64 #1 SMP Debian 5.10.216-1 (2024-05-03) x86_64
Database Type mysql
Database Version 10.5.23-MariaDB-0+deb11u1
Database Collation utf8mb4_unicode_ci
Database Connection Collation utf8mb4_general_ci
Database Connection Encryption None
Database Server Supports Connection Encryption Yes
PHP Version 8.1.29
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 5.1.0 Stable [ Kudumisha ] 16-April-2024 16:00 GMT
Joomla Backward Compatibility Plugin Enabled ()
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Additional comments
See text file for full system info and added visual on Admin menus for two installations.
The text was updated successfully, but these errors were encountered: