itamart / moodle-block_mhaairs

0 stars 5 forks source link

Fatal error: Can't use function return value in write context in /var/www/moodle/blocks/mhaairs/block_mhaairs_util.php on line 536 #9

Closed raskinv closed 9 years ago

raskinv commented 9 years ago

Trying to upgrade plugin version, and issuing any gradebook call.

RanQTGIT commented 9 years ago

On a similar note, UpdateScore (submit grade) calls return this: Notice: Undefined variable: DB in /var/www/moodle/blocks/mhaairs/externallib.php on line 411 Fatal error: Call to a member function get_field() on a non-object in /var/www/moodle/blocks/mhaairs/externallib.php on line 411

itamart commented 9 years ago

Thanks. Was not covered in the tests. Easy fix and I'm adding tests for that.

raskinv commented 9 years ago

The subject still happens with the new version

itamart commented 9 years ago

Ah! Was focused on Ran's comment which was a different issue. Let's make sure we separate issues. As for the main issue, never happens on my end, and it appears to be due to the fact that I'm running php 5 and you're not. So, I will fix that to support lower php versions, but php version is yet another thing we need to consider with respect to the plugin support.

raskinv commented 9 years ago

Our php version is 5.4.4-14+deb7u12

itamart commented 9 years ago

Yes, I'm running php 5.5.x and the error was due a use of the empty function on an expression, which is allowed since php 5.5. At any rate I have modified the affected code such that it is compatible with pre-5.5 and this issue should thereby be fixed.