I got these right off the bat as drupal status warnings. Maybe b.c of my PHP environment, not sure what they mean.

Strict warning: Declaration of LockSerializer::save() should be compatible with that of Serializer::save() in _registry_check_code() (line 3092 of /includes/bootstrap.inc).
Strict warning: Declaration of LockSerializer::updateField() should be compatible with that of Serializer::updateField() in _registry_check_code() (line 3092 of /includes/bootstrap.inc).
Strict warning: Declaration of Exchange::loadRecord() should be compatible with that of DBObject::loadRecord() in require_once() (line 839 of /sites/all/modules/ces/ces_bank/ces_bank.logic.inc).
Strict warning: Declaration of LocalAccount::loadRecord() should be compatible with that of DBObject::loadRecord() in require_once() (line 1118 of /sites/all/modules/ces/ces_bank/ces_bank.logic.inc).
Strict warning: Declaration of LimitChain::loadRecord() should be compatible with that of DBObject::loadRecord() in require_once() (line 1269 of /sites/all/modules/ces/ces_bank/ces_bank.logic.inc).

Comments

hongpong’s picture

Title: Strict warnings on fields » Strict warnings on child objects method parameters

Inconsistencies in object passed by reference makes warnings. In the parent class methods there are usually not ampersands with the parameter, but there are in the child methods.

Strict warning: Declaration of Exchange::loadRecord() should be compatible with that of DBObject::loadRecord() in require_once() (line 931 of ssites/all/modules/ces/ces_bank/ces_bank.logic.inc).

abstract class DBObject{
....
  protected function loadRecord($record) {
    $reflect = new ReflectionObject($this);
    foreach ($record as $key => $value) {
      if ($reflect->hasProperty($key) && $reflect->getProperty($key)->isPublic()) {
        $this->{$key} = $value;
      }
    }
  }

in ces_bank.logic.inc:

class Exchange extends DBObject {
....
  public function loadRecord(&$record) {
    parent::loadRecord($record);
    $this->currency = new Currency($record);
  }

etc. I think this is the same general condition on all of these.

esteve.badia’s picture

Ok, I changed my php environment and reproduced the bug. Indeed it seems exactly what you pointed out. So I'm going to fix it and pass the tests.

esteve.badia’s picture

Status: Active » Fixed

Fixed all these warning issues. Apart from the discussed strict warnings, there were a pair of more subtle notices that were exposing actual bugs. Concretely, I wasn't calling the proper user validate functions from the exchange creation form.

A bad side effect of this commit #9f5db62 is that the current create exchange form does not have default values in the Administrator tab. And it is a bit tricky to add them. So in order to have a coherent form perhaps an option is to empty all other default fields.

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 9f5db62 on master, 7.x-1.x, 2216627-docs, 1916476-Import_data_from_CES, 1401884-Notifications by esteve.badia:
    Issue #1999670 by esteve.badia: fixed strict warnings. Modified create...

  • Commit 9f5db62 on master, 7.x-1.x, 2216627-docs, 1916476-Import_data_from_CES, 1401884-Notifications, 2215167-interop by esteve.badia:
    Issue #1999670 by esteve.badia: fixed strict warnings. Modified create...

  • Commit 9f5db62 on master, 7.x-1.x, 2216627-docs, 1916476-Import_data_from_CES, 1401884-Notifications, 2215167-interop, 2215169-interop by esteve.badia:
    Issue #1999670 by esteve.badia: fixed strict warnings. Modified create...

  • Commit 9f5db62 on master, 7.x-1.x, 2216627-docs, 1916476-Import_data_from_CES, 1401884-Notifications, 2215167-interop, 2215169-interop, 2215171-interop by esteve.badia:
    Issue #1999670 by esteve.badia: fixed strict warnings. Modified create...

  • Commit 9f5db62 on 7.x-1.x, 2215167-interop, 2215169-interop, 2215171-interop, 1401884-Notifications by esteve.badia:
    Issue #1999670 by esteve.badia: fixed strict warnings. Modified create...

  • Commit 9f5db62 on 7.x-1.x, 2215167-interop, 2215169-interop, 2215171-interop, 1401884-Notifications, 1401884-Notifications_b by esteve.badia:
    Issue #1999670 by esteve.badia: fixed strict warnings. Modified create...

  • Commit 9f5db62 on 7.x-1.x, 2215167-interop, 2215169-interop, 2215171-interop, 1401884-Notifications, 1401884-Notifications_b, 2271149-opentransact by esteve.badia:
    Issue #1999670 by esteve.badia: fixed strict warnings. Modified create...

  • Commit 9f5db62 on 7.x-1.x, 2215167-interop, 2215169-interop, 2215171-interop, 1401884-Notifications, 1401884-Notifications_b, 2271149-opentransact, 2271629-Comments_in_offers by esteve.badia:
    Issue #1999670 by esteve.badia: fixed strict warnings. Modified create...

  • Commit 9f5db62 on 7.x-1.x, 2215167-interop, 2215169-interop, 2215171-interop, 1401884-Notifications_b, 2271149-opentransact, 2271629-Comments_in_offers, 1996122-Module_code_documentation by esteve.badia:
    Issue #1999670 by esteve.badia: fixed strict warnings. Modified create...

  • Commit 9f5db62 on 7.x-1.x, 2215167-interop, 2215169-interop, 2215171-interop, 1401884-Notifications_b, 2271149-opentransact, 1996122-Module_code_documentation, 2283781-accept-payments by esteve.badia:
    Issue #1999670 by esteve.badia: fixed strict warnings. Modified create...