it tries to access $relation->via->from[0]. However, this does not exist. Via is an array with keys 0, 1, 2 as shown below. The following error is thrown when generating the CRUD:
PHP Warning 'yii\base\ErrorException' with message 'Attempt to read property "from" on array'
$relation->via looks like this:
It seems like this happens only with many-to-many relations when using via(). (JUNCTION_RELATION_VIA_MODEL)
Changing $relation->via->from[0] to $relation->via->from[0] ?? $relation->via[0] seems to fix it, but I'm not sure if this is correct.
In the following line https://github.com/schmunk42/yii2-giiant/blob/0b063fd4ec31e29cee62ba17f97a370d788f787b/src/generators/crud/default/views/view.php#L161
it tries to access $relation->via->from[0]. However, this does not exist. Via is an array with keys 0, 1, 2 as shown below. The following error is thrown when generating the CRUD:
PHP Warning 'yii\base\ErrorException' with message 'Attempt to read property "from" on array'
$relation->via looks like this:
It seems like this happens only with many-to-many relations when using via(). (JUNCTION_RELATION_VIA_MODEL)
Changing $relation->via->from[0] to $relation->via->from[0] ?? $relation->via[0] seems to fix it, but I'm not sure if this is correct.
Giiant 0.15.0-beta2 Yii2 2.0.49.2