Experiencing a 401 Unauthorized Error During Update?

If you're seeing a 401 Unauthorized error when trying to update your Joomla extension, it's likely due to our new two-factor authentication (2FA) security measure for your Download ID.
To resolve this, check your email (Spam folder?) for a message to approve your server or device, or read our detailed blog post here( onlinecommunityhub.nl/best-practice/new-...-extension-downloads) to understand the steps involved. This will guide you through approving your server for future updates.

Implemented There is no "com_ochsubscriptions.site.script" asset of a "script" type in the r

Meer
3 maanden 3 weken geleden #3041 door joomill
Hi Ruud,

I hope you're doing fine.
I recieved this message today: "I would like to change my password on your site but under my account I go to Edit Profile and it has an error: There is no "com_ochsubscriptions.site.script" asset of a "script" type in the registry." When i checked it, there was an error indeed. 

This is fixed when i uncomment these lines at: /administrator/components/com_ochsubscriptions/models/fields/radio.php
    protected function getInput()
    {
        OchsubscriptionsHelper::setDebugLevel();
        /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
        //$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
        //$wa->useScript('com_ochsubscriptions.site.script');
        //if (Config::get('load_stylesheet')) {
        //$wa->useStyle('com_ochsubscriptions.element.ochsubscriptions-toggle');
        //}
        return parent::getInput();
    }

Maybe it will give me other errors but i didn't notice it yet.
There are no overrides and the error also occurs when i change the template to cassiopeia
Can you have a look at this?
Thanks in advance.
Jeroen
 
Onderwerp is gesloten.
Meer
3 maanden 3 weken geleden #3042 door Ruud van Lent
Good Morning Jeroen,
Holidays are over, well deserved rest as well :)

 This is fixed when i uncomment these lines at: /administrator/components/com_ochsubscriptions/models/fields/radio.php
 

You say that in de radio.php field you UNcomment the lines and that it then worked, but when looking at the original file (from the installation package), then you see that these lines are NOT commented.
so a little bit confused here: did you mean you commented the lines so they will not execute?

Do you have for me an url to the site you are experiencing this issue (front-end)?
Onderwerp is gesloten.
Meer
3 maanden 3 weken geleden #3043 door joomill
You're right. (It was late) I commented these lines.
I have also another site with ochsub and there everything works fine, so it should be something specific in my site/config.

I will create an account for you, so you can see.
(it's only on the user profile page)
Onderwerp is gesloten.
Meer
3 maanden 3 weken geleden #3044 door Ruud van Lent
Hi Jeroen,
can you add the following line in the ./administrator/components/com_ochsubscriptions/models/fields/radio.php
Code:
        $wa->getRegistry()->addExtensionRegistryFile('com_ochsubscriptions');

the code should then look like this:
Code:
    /**      * Method to get the field input markup for calendar dates.      *      * @return  string  The field input markup.      */     protected function getInput()     {         OchsubscriptionsHelper::setDebugLevel();         /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */         $wa = Factory::getApplication()->getDocument()->getWebAssetManager();         $wa->getRegistry()->addExtensionRegistryFile('com_ochsubscriptions');         $wa->useScript('com_ochsubscriptions.site.script');         if (Config::get('load_stylesheet')) {             $wa->useStyle('com_ochsubscriptions.element.ochsubscriptions-toggle');         }         return parent::getInput();     }
Onderwerp is gesloten.
Meer
3 maanden 3 weken geleden #3045 door joomill
This works as expected, Thank you!
Onderwerp is gesloten.
Meer
3 maanden 3 weken geleden #3046 door Ruud van Lent
Top,
so the 'issue' is that on this particular page com_ochsubscriptions is not 'booted' and as such the assets registry file is not loaded.
The radio.php (toggle) is loaded on the form via the ochsubscriptions system plugin, the form is displayed by com_users.

The fix we have now is to force load the com_ochsubscriptions asset registry. This will then ensure that the registry is available even in cases when not all components (ochsubscription in this case) are booted.

On the other sites where it works correct, ochsubscriptions is correctly booted even when on the com_users page. Why this is not the case on this site is not clear and would need a deepdive into the site.

I will add this as a fix in the new version.

Thanks for reporting!
Onderwerp is gesloten.