iFAQ auto expand all [solution]

The Joomla! extension iFAQ from Ideal Extensions is a nice way of building a FAQ (Frequently Asked Questions) section on your website.

One feature I am missing though is to be able to select wether a FAQ list of articles should default to all open instead of closed. This is a simple workaround.

Add a module of the type Custom HTML and edit the module content using no editor. Publish the module in a suitable module position, like Debug.

Insert the following javascript into the module (remember, no editor mode):

<script>
jQuery(document).ready(function($) { 
  jQuery( "#expand-all" ).click(); 
});
</script>

By selecting which menu items the module is displayed for, you can choose the FAQ pages where you want to have the articles expanded by default.

Prestashop multistore – can’t get out of maintenance mode

After maintenance even though setting to shop to active, frontend still shows maintenance mode. This can occur when multistore is enabled.

Solution:

  • Use for example phpMyAdmin to access the shop database
  • Find the ps_configuration table
  • Find all records with the name PS_SHOP_ENABLE and change them from ‘0’ to ‘1’ (there are probably more than one)
Joomla breadcrumbs not working, solved in JoomSEF by entering ItemID

Breadcrumbs only showing “Home” for Joomla article

A Joomla article was published through a menu item (single article) but the breadcrumbs when displaying the article only showed “Home” (not clickable). The menu path and article title was missing in the breadcrumbs.

In this case JoomSEF was installed on the site. The solution was to find the SEF URL in JoomSEF (go to “Manage SEF URLs”). The ItemID field was empty.

The problem was solved by entering the menu ID for the menu item displaying the article in the ItemID field, saving and clearing the cache.

WordPress shows white page after site move

WordPress just showing a white page means it is experienceing PHP errors. When it occurs after a site has been moved from one hosting to another it can be caused by several reasons.

To make it possible to track down the cause you can temporarily add the following to the .htaccess file in the root. If this gives you a internal server error 500 it means it is not allowed by the host. If allowed, you will get error messages from PHP dispayed on screen when accessing the site:

php_flag display_startup_errors on
php_flag display_errors on

There are visbible PHP ending tags ?> on the site

If you see more or less normal output from the site but once in a while you see lines ending with ?>. This can happen if the site has been running on PHP 5 where the short PHP start tag <? is allowed (instead of the longer <?php.

If the site has been moved to PHP 7 where this is not longer allowed, it can cause this kind of strange behaviour.

If you don’t want to go through all the code and find all the occurrences of <? and replace them with <?php (which is one solution), you can simply add the following to your php.ini:

short_open_tag=On

You need to restart Apache after this.

Wordfence plugin is installed

You need to manually edit the system specific paths in the following files:

  • .user.ini in the site root, change the path after auto_prepend_file
  • wordfence-waf.php in the site root, change the paths on all occurrences

WP Rocket plugin is installed

The file wp-content/advanced-cache.php contains system specific paths. You can manually update them or just simply delete the file and login to wp-admin of the site and it will be recreated automatically with the correct paths.

Call Book Log 3 installation with custom database name

Call Book Log 3 is a log book program for radio amateurs, hosted on a web server, based on PHP 7 and MySQL/mariaDB.

The database for the software is named ‘hamcallbook‘ by default but if you are going to host it on a server where you can’t choose the name of the database, like a web hosting company (“web hotel”) it will not install.

The solution is to simply edit the file setup2.php before starting the installation process. Search for all occurrences of ‘hamcallbook‘ and replace it with your database name.

After installing, edit the file dbconnect.php, find ‘hamcallbook‘ and replace it with your database name.

pfsense IPsec phase 1 disable rekey

pfsense IPsec VPN tunnel disconnects after 8 hours

I’ve been troubled by the annoying disconnection of the IPsec VPN tunnel on a pfsense firewall. The tunnel disconnects after about 8 hours.

The solution in my case was to enable “Disable rekey” which “Disables renegotiation when a connection is about to expire.“. The setting is found under Phase 1 advanced settings.

Disable rekey setting under Phase 1 Advanced settings

MySQL Error 1215: Cannot add foreign key constraint

Check that both tables have the same engine type, so there isn’t a mix of for example MyISAM and InnoDB.

rm unable to delete file even as root or sudo [Solved]

When it is not possible to delete a file using rm even when logged in as root or by using sudo, check the file attributes with:

lsattr filename.ext

If it has the “i” attribute, this is preventing the file from being deleted, even by super users. When you have verified the reason for this and still want to delete the file then remove the “i” attribute with:

chattr -i filename.ext

Then delete the file using rm as you normally would.

Ispconfig3: Let’s Encrypt not working

There can be several reasons for Let’s Encrypt certificates not being issued for sites. These are some things to check:

  • When creating a new website, save it first, then open it again and check Let’s encrypt and then save it (i.e. don’t check the Let’s Encrypt unless the website has been saved at least once in Ispconfig3)
  • Delete any existing certificates under the SSL tab for the website, including self signed
  • Check that all host names for the website and webaliases are pointing to the correct server
  • Use A records, not CNAME
  • Make sure there are no redirects on the website
  • Check for error messages in the log file; /var/log/letsencrypt/letsencrypt.log
  • If you get messages in the letsencrypt.log file like;
    “Please choose an account
    Choises: “
    Then check /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory and if there are more than one account (subdirectory) move all but one to another location.
  • Check the web logs for the site, both access and error logs, for accesses to .well-known/acme-challenge/* and verify that they are served properly (status code 200)