Skip to content

Commit

Permalink
default value for image column is null now
Browse files Browse the repository at this point in the history
  • Loading branch information
Vítězslav Dvořák committed Jan 14, 2025
1 parent ad1eee2 commit 14c71af
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
24 changes: 24 additions & 0 deletions db/migrations/20250114190157_app_image_fix.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AppImageFix extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change(): void
{

}
}
6 changes: 4 additions & 2 deletions src/MultiFlexi/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public function importAppJson($jsonFile)

if (\is_array($importData)) {
$importData['enabled'] = 'on';

$importData['image'] = '';
$environment = \array_key_exists('environment', $importData) ? $importData['environment'] : [];
unset($importData['environment']);
$this->addStatusMessage('Importing '.$importData['name'].' from '.$jsonFile.' created by '.$importData['multiflexi'], 'debug');
Expand Down Expand Up @@ -368,7 +368,9 @@ public function importAppJson($jsonFile)
} catch (\PDOException $exc) {
echo $exc->getTraceAsString();
$problemData = $this->getData();
$problemData['image'] = substr((string) $problemData['image'], 0, 20).' ...';
if(array_key_exists('image', $currentData)){
$problemData['image'] = substr((string) $problemData['image'], 0, 20).' ...';
}
fwrite(\STDERR, print_r($problemData, true).\PHP_EOL);
echo $exc->getMessage();
}
Expand Down

0 comments on commit 14c71af

Please sign in to comment.