Closed stian-overasen closed 6 years ago
Fixed in #36
I disagree with this change. This contradicts the concept of strict data types. Validating the variable as an array before using the structure_card_data()
method would be a ~better~ safer way to go. The method will still fail for any non-array variable that evaluates to not empty.
👍 Can you make a PR on it?
Fixed in #37
Adding a empty card module without any card gives this error:
Fatal error: Uncaught TypeError: Argument 1 passed to Dekode\Hogan\Grid::structure_card_data() must be of the type array, boolean given, called in /app/public/content/plugins/hogan-grid/class-grid.php on line 295 and defined in /app/public/content/plugins/hogan-grid/class-grid.php:308
Theres a need to validate data at the start of
load_args_from_layout_content()
https://github.com/DekodeInteraktiv/hogan-grid/blob/master/class-grid.php#L293