AppConfig::updateConfiguration() Calls Undefined Method AccessControl::canAdmin() Instead of isAdmin()
- Product: JoomShaper EasyStore (
com_easystore) - Product Version:
3.1.1 - Joomla Version:
6.2.0(PHP8.4) - File:
administrator/components/com_easystore/src/Traits/AppConfig.php(updateConfiguration(), line 548)
What the Bug Is
When an administrator edits Sender's Name or Sender's Email in EasyStore -> Settings -> Emails (option=com_easystore&view=settings#/emails), the React frontend sends a PATCH request to option=com_easystore&task=/api.updateConfiguration. On line 548 of administrator/components/com_easystore/src/Traits/AppConfig.php, updateConfiguration() calls $acl->canAdmin(), which does not exist on JoomShaper\Component\EasyStore\Administrator\Supports\AccessControl (the method defined at line 213 of AccessControl.php and used at line 243 of AppConfig.php is isAdmin()). PHP throws a fatal Error: Call to undefined method ...AccessControl::canAdmin(), returning an HTTP 500 HTML error page and causing the React UI to display an empty red error toast without saving the setting.
How to Reproduce It
- Log in to the Joomla Administrator backend as a Super User and open Components -> EasyStore -> Settings -> Emails (
/administrator/index.php?option=com_easystore&view=settings#/emails). - Change Sender's Email or Sender's Name and blur/save the field.
- The
POST /administrator/index.php?option=com_easystore&task=/api.updateConfigurationrequest fails with HTTP500(Call to undefined method JoomShaper\Component\EasyStore\Administrator\Supports\AccessControl::canAdmin()), an empty red toast appears at the bottom of the screen, andconfiguration.phpis not updated.
Fix (Unified Patch Against Clean com_easystore 3.1.1)
--- a/administrator/components/com_easystore/src/Traits/AppConfig.php
+++ b/administrator/components/com_easystore/src/Traits/AppConfig.php
@@ -545,7 +545,7 @@
$acl = AccessControl::create();
- if (!$acl->canAdmin()) {
+ if (!$acl->isAdmin()) {
$this->sendResponse(['message' => Text::_('COM_EASYSTORE_PERMISSION_ERROR_MSG')], 403);
}