bug: Table::addIncludePath() removed in Joomla 5 - fatal crash on install #90

Closed
opened 2026-05-22 03:29:24 +00:00 by jmiller · 1 comment
Owner

Description

script.php lines 191 and 298 use Table::addIncludePath() which was deprecated in Joomla 4 and removed in Joomla 5. This causes a fatal PHP error during installation on Joomla 5.x.

Impact

The entire installation postflight crashes on Joomla 5, preventing article and menu item auto-provisioning.

Fix

Replace with Joomla 5 MVCFactory pattern:

$app = Factory::getApplication();
$mvcFactory = $app->bootComponent('com_content')->getMVCFactory();
$table = $mvcFactory->createTable('Article', 'Administrator');

Files

  • src/script.php:191 - Table::addIncludePath for content
  • src/script.php:298 - Table::getInstance for menu
## Description `script.php` lines 191 and 298 use `Table::addIncludePath()` which was deprecated in Joomla 4 and removed in Joomla 5. This causes a fatal PHP error during installation on Joomla 5.x. ## Impact The entire installation `postflight` crashes on Joomla 5, preventing article and menu item auto-provisioning. ## Fix Replace with Joomla 5 MVCFactory pattern: ```php $app = Factory::getApplication(); $mvcFactory = $app->bootComponent('com_content')->getMVCFactory(); $table = $mvcFactory->createTable('Article', 'Administrator'); ``` ## Files - `src/script.php:191` - Table::addIncludePath for content - `src/script.php:298` - Table::getInstance for menu
jmiller added the joomlapriority: criticalbug labels 2026-05-22 03:29:24 +00:00
Author
Owner

Testing Steps -- Joomla 5 MVCFactory table access

Setup

  1. Install a fresh Joomla 5.x instance (5.0+ required)
  2. Build the plugin ZIP from the dev branch

Test A: Clean install creates article and menu

  1. Install the plugin ZIP via System > Install > Extensions
  2. Check for success messages (article created, menu item created)
  3. Go to Content > Articles -- verify "Terms of Service" article exists
  4. Go to Menus > Legal -- verify "Terms of Service" menu item exists
  5. Expected: No PHP fatal errors, no blank white page during install

Test B: Verify no Table::addIncludePath usage

  1. Enable Joomla debug mode and error reporting = Maximum
  2. Install the plugin
  3. Check the Joomla debug console and PHP error log
  4. Expected: No deprecation warnings about Table::addIncludePath or Table::getInstance

Pass criteria

  • Plugin installs without fatal errors on Joomla 5.x
  • Article and menu item are created successfully
  • No deprecation warnings in debug output
## Testing Steps -- Joomla 5 MVCFactory table access ### Setup 1. Install a fresh **Joomla 5.x** instance (5.0+ required) 2. Build the plugin ZIP from the `dev` branch ### Test A: Clean install creates article and menu 1. Install the plugin ZIP via **System > Install > Extensions** 2. Check for success messages (article created, menu item created) 3. Go to **Content > Articles** -- verify "Terms of Service" article exists 4. Go to **Menus > Legal** -- verify "Terms of Service" menu item exists 5. **Expected:** No PHP fatal errors, no blank white page during install ### Test B: Verify no Table::addIncludePath usage 1. Enable Joomla debug mode and error reporting = Maximum 2. Install the plugin 3. Check the Joomla debug console and PHP error log 4. **Expected:** No deprecation warnings about `Table::addIncludePath` or `Table::getInstance` ### Pass criteria - [ ] Plugin installs without fatal errors on Joomla 5.x - [ ] Article and menu item are created successfully - [ ] No deprecation warnings in debug output
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomTOS#90