Black Friday 2026 50% off every plan Our biggest deal of the year on #1 Joomla products.
Ends in 15d 08h 07m 00s
Claim 50% off
Staff replied EasyStore Joomla 6 v3.1.1

AppConfig::updateConfiguration()` Calls Undefined Method `AccessControl::canAdmin()` Instead of `isAdmin()

Asked by Philip S. Hempel 1 week ago Last activity 1 week ago

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 (PHP 8.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

  1. 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).
  2. Change Sender's Email or Sender's Name and blur/save the field.
  3. The POST /administrator/index.php?option=com_easystore&task=/api.updateConfiguration request fails with HTTP 500 (Call to undefined method JoomShaper\Component\EasyStore\Administrator\Supports\AccessControl::canAdmin()), an empty red toast appears at the bottom of the screen, and configuration.php is 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);
         }

1 reply

Mehtaz Afsana Borsha Staff

Hi,

Thank you for the detailed bug report, reproduction steps, and proposed patch.

We appreciate your efforts in identifying this issue with EasyStore 3.1.1.

Based on your findings, the updateConfiguration() method appears to call canAdmin(), which is not defined in the AccessControl class. This may cause the HTTP 500 error when updating email settings.

Your suggested fix to replace canAdmin() with isAdmin() appears reasonable, as isAdmin() is already defined and used elsewhere in the component.

We'll forward your findings and proposed patch to our development team for verification and further review.

Thank you again for your valuable contribution and for helping us improve EasyStore.

Best regards

Log in to reply.