markocupic / fontawesome-icon-picker-bundle

2 stars 2 forks source link

Warnung im Debug Modus Fehler im Validator #4

Closed pbd-kn closed 1 year ago

pbd-kn commented 1 year ago

Hi Marko,

ich habe das mal eingebaut. In der Produktionsumgebung bekomme ich die Icons angezeigt. Im Debug kommt die Warnung Warning: Attempt to read property "faIcon" on null in C:\wampneu\www\co4\websites\co4raw\vendor\markocupic\fontawesome-icon-picker-bundle\src\ContaoBackendWidget\FontawesomeIconPicker.php (line 54)

        $arrIconsAll = $iconUtil->getIconsAll();
        $varValue = '';
        $selectedIcon = null;
        $selectedIconPrefix = null;
        $arrIcon = StringUtil::deserialize($model->faIcon);
        $arrIcons = [];
        if (!empty($arrIcon) && \is_array($arrIcon)) {
            $varValue = implode('||', StringUtil::deserialize($model->faIcon, true));

Im Produktionsmodus bekomme ich einen Fehler aus dem Validator geliefert. [2023-07-17T11:57:19.347301+00:00] request.CRITICAL: Uncaught PHP Exception TypeError: "explode(): Argument #2 ($string) must be of type string, null given" at C:\wampneu\www\co4\websites\co4raw\vendor\markocupic\fontawesome-icon-picker-bundle\src\ContaoBackendWidget\FontawesomeIconPicker.php line 111 {"exception":"[object] (TypeError(code: 0): explode(): Argument #2 ($string) must be of type string, null given at C:\wampneu\www\co4\websites\co4raw\vendor\markocupic\fontawesome-icon-picker-bundle\src\ContaoBackendWidget\FontawesomeIconPicker.php:111)"} []

protected function validator(mixed $varInput): mixed
{
    $varInput = explode('||', $varInput);
    $varInput = serialize($varInput);

    return parent::validator($varInput);
}

Mache ich irgendwo etwas falsch

Mein dca Field
'fontawesomeIconPicker' => [ 'label' => 'fontawesomeIconPicker', 'inputType' => 'fontawesomeIconPicker', 'sql' => "varchar(255) NOT NULL default ''", ], Mein Icon-Fenster sieht so aus das icon 500px habe ich ausgewählt.

Der Fehler tritt auff, wenn ich abspeichere grafik

LG Peter

LupusVII commented 1 year ago

Hi! You should use a blob NULL as sql settings :)

pbd-kn commented 1 year ago

das ändert nichts mein dca ist nun 'fontawesomeIconPicker' => [ 'label' => 'fontawesomeIconPicker', 'inputType' => 'fontawesomeIconPicker', 'sql' => 'blob NULL', ],

Beim Speichern Fehler in Zeile 111 bei Validate request.CRITICAL: Uncaught PHP Exception TypeError: "explode(): Argument https://github.com/markocupic/fontawesome-icon-picker-bundle/pull/2 ($string) must be of type string, null given" at C:\wampneu\www\co4\websites\co4raw\vendor\markocupic\fontawesome-icon-picker-bundle\src\ContaoBackendWidget\FontawesomeIconPicker.php line 111 {"exception":"[object] (TypeError(code: 0): explode(): Argument https://github.com/markocupic/fontawesome-icon-picker-bundle/pull/2 ($string) must be of type string, null given at C:\wampneu\www\co4\websites\co4raw\vendor\markocupic\fontawesome-icon-picker-bundle\src\ContaoBackendWidget\FontawesomeIconPicker.php:111)"}

im Debugmode der Abbruch mit der Warnung beim Öffen zeile 54 $arrIcon = StringUtil::deserialize($model->faIcon); Warning: Attempt to read property "faIcon" on null in C:\wampneu\www\co4\websites\co4raw\vendor\markocupic\fontawesome-icon-picker-bundle\src\ContaoBackendWidget\FontawesomeIconPicker.php (line 54) ich nehme an die Zeile 43 liefert Null

markocupic commented 1 year ago

Hallo Peter 

 

Sollte nun behoben sein.

 

Lg Marko  


Marko Cupic Surenweidstr. 2 CH-6208 Oberkirch

http://4ae-racing-team.ch http://kletterkader.com

   

Gesendet: Montag, 17. Juli 2023 um 14:36 Uhr Von: "pbd-kn" @.> An: "markocupic/fontawesome-icon-picker-bundle" @.> Cc: "Subscribed" @.***> Betreff: [markocupic/fontawesome-icon-picker-bundle] Warnung im Debug Modus Fehler im Validator (Issue #4)

 

Hi Marko,

ich habe das mal eingebaut. In der Produktionsumgebung bekomme ich die Icons angezeigt. Im Debug kommt die Warnung Warning: Attempt to read property "faIcon" on null in C:\wampneu\www\co4\websites\co4raw\vendor\markocupic\fontawesome-icon-picker-bundle\src\ContaoBackendWidget\FontawesomeIconPicker.php (line 54)

    $arrIconsAll = $iconUtil->getIconsAll();
    $varValue = '';
    $selectedIcon = null;
    $selectedIconPrefix = null;
    $arrIcon = StringUtil::deserialize($model->faIcon);
    $arrIcons = [];
    if (!empty($arrIcon) && \is_array($arrIcon)) {
        $varValue = implode('||', StringUtil::deserialize($model->faIcon, true));

Im Produktionsmodus bekomme ich einen Fehler aus dem Validator geliefert. [2023-07-17T11:57:19.347301+00:00] request.CRITICAL: Uncaught PHP Exception TypeError: "explode(): Argument #2 ($string) must be of type string, null given" at C:\wampneu\www\co4\websites\co4raw\vendor\markocupic\fontawesome-icon-picker-bundle\src\ContaoBackendWidget\FontawesomeIconPicker.php line 111 {"exception":"[object] (TypeError(code: 0): explode(): Argument #2 ($string) must be of type string, null given at C:\wampneu\www\co4\websites\co4raw\vendor\markocupic\fontawesome-icon-picker-bundle\src\ContaoBackendWidget\FontawesomeIconPicker.php:111)"} []

protected function validator(mixed $varInput): mixed { $varInput = explode('||', $varInput); $varInput = serialize($varInput);

return parent::validator($varInput);

}

Mache ich irgendwo etwas falsch

Mein dca Field 'fontawesomeIconPicker' => [ 'label' => 'fontawesomeIconPicker', 'inputType' => 'fontawesomeIconPicker', 'sql' => "varchar(255) NOT NULL default ''", ], Mein Icon-Fenster sieht so aus das icon 500px habe ich ausgewählt.

Der Fehler tritt auff, wenn ich abspeichere

LG Peter

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

pbd-kn commented 1 year ago

Danke, schön dasssa uch der Fehler zugriff auf contenmodel->faicon behoben ist