[4.x.x.x] Wrong events after upgrade 4.1.0.3 > 4.1.0.4
Author: tongo-angelovCreated Aug 16, 2026Updated Aug 23, 2026
What version of OpenCart are you reporting this for? 4.1.0.4
Describe the bug When upgrading to 4.1.0.4 in step 5 upgrade_5.php it changes all view events to include a dot instead of forward flash
admin/view/common/header/after
admin/view/common.header/afterTo Reproduce Steps to reproduce the behavior:
- Fresh 4.1.0.3 install
- Install any extension that has view event (tested with this since I had it already and its free for testing)
- Following upgrade docs, download all 4.1.0.4 files and replace previous. Go to /install and complete upgrade
- Go to admin dashboard and test if extension is working
Expected behavior Extension should still be working since 4.1.0.4 is backwards compatible with 4.1.0.3
Screenshots / Screen recordings
4.1.0.3
4.1.0.4
Server / Test environment (please complete the following information):
- Ubuntu Server
- PHP v8.3
- Apache/2.4.58
Additional context For testing I just added a check for /view events so it keeps the slash
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "event`");
foreach ($query->rows as $result) {
// if (!str_contains($result['trigger'], '.')) {
// Added /view check to stop from replacing /
if (!str_contains($result['trigger'], '.') && !str_contains($result['trigger'], '/view/')) {
$parts = explode('/', $result['trigger']);
$string_1 = implode('/', array_slice($parts, 0, -2));
$string_2 = implode('/', array_slice($parts, -2));
$this->db->query("UPDATE `" . DB_PREFIX . "event` SET `trigger` = '" . $this->db->escape($string_1 . '.' . $string_2) . "' WHERE `event_id` = '" . (int)$result['event_id'] . "'");
}
}Source: opencart/opencart