1

All my sites are crashing when the login module is brought up from a link. If the module is left on the site (without a link) the site crashes. I still have admin access and I have disabled the login module. Here is the error message:

Error: 0 You may not be able to visit this page because of:

an out-of-date bookmark/favourite a search engine that has an out-of-date listing for this site a mistyped address you have no access to this page The requested resource was not found. An error has occurred while processing your request. Please try one of the following pages:

Home Page Search this site If difficulties persist, please contact the website administrator and report the error below..

count(): Argument #1 ($value) must be of type Countable|array, null given

  1. Deleted and reestablished front-end login module
  2. I still have admin access and I have disabled the front-end login module.
  3. Ran the update on 3 other Joomla installs with varying installed modules. Same results.
  4. I use TemplateToaster for templates. I have tried other templates. Same results.
  5. No errors in Joomla Update log
  6. PHP error log:

# #Date: 2022-09-08 23:50:26 UTC #Software: Joomla! 4.1.5 Stable [ Kuamini ] 21-June-2022 14:00 GMT

#Fields: datetime priority clientip category message 2022-09-08T23:50:26+00:00 INFO 98.220.192.240 joomlacanceled
2022-09-08T23:52:06+00:00 INFO 98.220.192.240 joomlafailure Username and password do not match or you do not have an account yet. 2022-09-08T23:52:35+00:00 INFO 98.220.192.240 joomlafailure Username and password do not match or you do not have an account yet. 2022-09-08T23:54:26+00:00 INFO 98.220.192.240 joomlafailure Username and password do not match or you do not have an account yet.



I think the issue is the TemplateToaster templates I am using:

Diagnosis:

  1. All 6 of my sites have TemplateToaster templates. All have this issue.

  2. I installed a 404 diag module on one site and threw many errors. I can forward them to you.

  3. I did a clean Joomla 4.2.2 install.

    a. It works fine with the Cassiopia template.

    b. It crashes with one of the templates I created from scratch with TemplateToaster.

    c. It also crashes with one of the default Templates that come with TemplateToaster. U-finance

    d. I tried to use one of your downloadable free templates and it would not install. Error: JInstaller: :Install: Can't find XML setup file. Unable to detect manifest file.

4
  • A comparison of the mod_login code between 4.2 and an early version shows there was code removed/changed around Two Factor Authentication. Are you using 2FA on your site? If so maybe turning it off might help.
    – Irata
    Sep 10, 2022 at 4:54
  • I was not using 2 factor, and that choice now only for multi. I enabled it in my sandbox site and it still has the same result.
    – Jim Beal
    Sep 11, 2022 at 16:22
  • Are you able to provide a link to enable people who want to help you to download and install at least one of the Templates you are using that is causing the problem. Without being able to see more diagnostics or be able to recreate error there is not enough information to go on at this stage in my opinion. Have you contacted Template Toaster and asked if they seen any similar/related issues reported?
    – Irata
    Sep 12, 2022 at 2:05
  • Sure. It is Salem48nss.zip at: bealsbits.com/download
    – Jim Beal
    Sep 13, 2022 at 14:04

2 Answers 2

0

This is caused by one of many backwards compatibility breaks introduced in J! 4.2. Any template that has a layout override of Login module is now broken. The break will not be reverted so end users and template developers have to fix this themselves. The fix is to remove the code related to the no longer existing $twofactormethods variable from the layout which is usually located in templates/[your_template]/html/mod_login directory. In your case the code to remove is this:

<?php if (count($twofactormethods) > 1) : ?>
<p id="form-login-secretkey">
<?php if (!$params->get('usetext', 0)) : ?>
<label for="modlgn-secretkey" class="element-invisible"><?php echo JText::_('JGLOBAL_SECRETKEY'); ?></label>
<input id="modlgn-secretkey"autocomplete="off" type="text"name="secretkey" class="boxcolor"tabindex="0"size="18"  />
<?php else : ?>
<label for="modlgn-secretkey"><?php echo JText::_('JGLOBAL_SECRETKEY'); ?></label>
<input id="modlgn-secretkey"autocomplete="off"type="text"name="secretkey"class="boxcolor"tabindex="0"size="18"/>
<?php endif; ?>
</p>
<?php endif; ?>
1
  • Thanks. I tried it to no avail. But the issue (for me) seems to be directly linked to the template. TemplateToaster templates do not work, but others do.
    – Jim Beal
    Sep 15, 2022 at 19:49
0

I have tried to comment out using /* ... */ the codes you listed above, and could not fix the issue. I have also commented out the whole block of two factor methods as follows,

<?php if (count($twofactormethods) > 1) : ?>*/
            <div class="mod-login__twofactor form-group">
                <?php if (!$params->get('usetext', 0)) : ?>
                    <div class="input-group">
                        <span class="input-group-text">
                            <span class="icon-star" aria-hidden="true"></span>
                        </span>
                         <label for="modlgn-secretkey-<?php echo $module->id; ?>" class="visually-hidden"><?php echo Text::_('JGLOBAL_SECRETKEY'); ?></label>
                         <input id="modlgn-secretkey-<?php echo $module->id; ?>" autocomplete="one-time-code" type="text" name="secretkey" class="form-control" placeholder="<?php echo Text::_('JGLOBAL_SECRETKEY'); ?>"> 
                        <span class="input-group-text">
                            <span class="icon-question icon-fw" aria-hidden="true"></span>
                        </span>
                    </div>
                <?php else : ?>
                     <label for="modlgn-secretkey-<?php echo $module->id; ?>"><?php echo Text::_('JGLOBAL_SECRETKEY'); ?></label>
                    <div class="input-group">
                         <input id="modlgn-secretkey-<?php echo $module->id; ?>" autocomplete="one-time-code" type="text" name="secretkey" class="form-control" placeholder="<?php echo Text::_('JGLOBAL_SECRETKEY'); ?>"> 
                        <span class="input-group-text">
                            <span class="icon-question icon-fw" aria-hidden="true"></span>
                        </span>
                    </div>
                 <?php endif; ?> 
            </div>
         <?php endif; ?> 

I was still not able to recover. The safest way I did was to reinstall 4.2.2 and using back the configuration.php, and everything starts to fall into place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.