Some models are broken on PHP 7+

451
Defect
alex
Jack
3.7.2
3.7.2
Core
Accepted
Highest
Blocker
7 months ago
7 months ago
0

Description

What did you do to cause this? Fresh installation

What page were you on? /users/1 and /admin/

What PHP and MariaDB versions do you run? PHP 7.1.1 and MariaDB 15.1

Describe the defect: PHP7 changed how variables-variables are processed (explanation here). Among other things, it makes the group view unloadable and breaks functionality such as admin panel.

I know that PHP 7 isn't officially supported in 3.X, but the fix is easy and won't break PHP 5.

File vendor/avalon/database/model.php line #401 changes from:

return $this->$var = $model::find($belongs_to['foreign_key'], $this->$belongs_to['column']);

To:

return $this->$var = $model::find($belongs_to['foreign_key'], $this->{$belongs_to['column']});

Ticket History

7 months ago by Jack

  • Set Component to Core
  • Changed Severity from Normal to Blocker
  • Changed Priority from Normal to Highest
  • Changed Status from New to Accepted
  • Assigned ticket to Jack

Thank you for the report, I have not tested on PHP 7 much. Will try to get this done ASAP after work. Thank you again.