Skip to content

Commit

Permalink
Fix issue Astroid menu module position resets after updating Astroid #…
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed Nov 1, 2024
1 parent aa4a7a3 commit 6f99ee7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions script.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,16 @@ public function installModule($module, $module_dir)
$db->setQuery($query);
$db->execute();

$query = $db->getQuery(true);
$query->update('#__modules');
$query->set($db->quoteName('published') . ' = 1');
$query->set($db->quoteName('position') . ' = ' . $db->quote('status'));
$query->set($db->quoteName('params') . ' = ' . $db->quote('{"layout":"_:default","moduleclass_sfx":"","style":"0","module_tag":"div","bootstrap_size":"0","header_tag":"h3","header_class":""}'));
$query->where($db->quoteName('module') . ' = ' . $db->quote($module_name));
$db->setQuery($query);
$db->execute();
if ($module_name === 'mod_astroid_clear_cache') {
$query = $db->getQuery(true);
$query->update('#__modules');
$query->set($db->quoteName('published') . ' = 1');
$query->set($db->quoteName('position') . ' = ' . $db->quote('status'));
$query->set($db->quoteName('params') . ' = ' . $db->quote('{"layout":"_:default","moduleclass_sfx":"","style":"0","module_tag":"div","bootstrap_size":"0","header_tag":"h3","header_class":""}'));
$query->where($db->quoteName('module') . ' = ' . $db->quote($module_name));
$db->setQuery($query);
$db->execute();
}

// Retrieve ID
$query = $db->getQuery(true);
Expand Down

0 comments on commit 6f99ee7

Please sign in to comment.