No Code Attached Yet bug
avatar Roeilab
Roeilab
23 Nov 2024

Steps to reproduce the issue

  • Create an install script in line with Joomla documentation https://manual.joomla.org/docs/building-extensions/install-update/installation/install-process/
  • Add the script to the manifest of your template
  • Add two lines of code to the preflight function (line 1 and 4 below):
    use Joomla\CMS\Log\Log;
    public function preflight(string $type, InstallerAdapter $parent): bool
    {
    Log:add('preflight: ' . $type);
    return true;
    }
  • Install your template, and set it to default (you can do that in postflight function or manually)
  • Uninstall your template

Expected result

  1. The line 'preflight: uninstall' is written to the log file
  2. Joomla throws a warning: Template Uninstall: Can't remove default template

Actual result

  1. Joomla throws a warning: Template Uninstall: Can't remove default template
  2. The line 'preflight: uninstall' is NOT written to the log file

System information (as much as possible)

Additional comments

In the preflight function you should have the opportunity to set the cassiopeia template back to default, and then proceed with uninstall of your custom template. That way you avoid: Template Uninstall: Can't remove default template. That is how it worked on older versions of the install script. But now the uninstall aborts before preflight.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
4.00

avatar Roeilab Roeilab - open - 23 Nov 2024
avatar Roeilab Roeilab - change - 23 Nov 2024
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 23 Nov 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 Nov 2024
avatar Hackwar Hackwar - change - 23 Nov 2024
Labels Added: bug
avatar Hackwar Hackwar - labeled - 23 Nov 2024

Add a Comment

Login with GitHub to post a comment