Skip to content

Commit

Permalink
#2 Fix: Migrations not running properly + undefined key DROP
Browse files Browse the repository at this point in the history
Contao\InstallationBundle\Database\Installer::execCommand(): Argument
         #1 ($hash) must be of type string, int given, called in
         vendor/contao/core-bundle/src/Command/MigrateCommand.php on line 482
  • Loading branch information
amenk committed Apr 19, 2024
1 parent fb09019 commit c8cb0f5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions RelatedHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
namespace Psi\News4ward;

class RelatedHelper extends \Controller
class RelatedHelper extends \Controller
{

public function __construct()
Expand All @@ -38,7 +38,7 @@ public function sqlCompileCommands($arrData)
$arrAllModules = scan(TL_ROOT . '/system/modules');

// remove DROP statment for tl_news4ward_articleWithTags if news4ward_tags is installed
if(is_array($arrData['DROP']))
if(isset($arrData['DROP']) && is_array($arrData['DROP']))
{
foreach($arrData['DROP'] as $k => $v)
{
Expand All @@ -60,8 +60,8 @@ public function sqlCompileCommands($arrData)
// if news4ward_tags is installed tell contao to CREATE VIEW if not already done
if(in_array('news4ward_tags',$arrAllModules) && !$this->Database->tableExists('tl_news4ward_articleWithTags'))
{
$arrData['CREATE'][] = $this->viewCreateQry;
}
$arrData['CREATE'][md5($this->viewCreateQry)] = $this->viewCreateQry;
}

return $arrData;
}
Expand All @@ -82,5 +82,3 @@ public function fixView()
}
}
}

?>

0 comments on commit c8cb0f5

Please sign in to comment.