I'm currently looking at the domain module and it looks very promising for my use case. Thanks!

I've found two places where an E_NOTICE gets thrown:

  1. When creating a new user (/admin/user/user/create), the following notice appears:
    notice: Trying to get property of non-object in X/sites/all/modules/domain/domain.module on line 618.
    domain_get_user_domains gets called through domain_user($op="register").
    I've fixed it by checking for a given $account (which is NULL in this case) in domain_get_user_domains()
  2. The second E_NOTICE affects domain.module, where $www_replaced needs to get initialized to FALSE. I wonder why this notice has not been recognized/fixed before?

The patch is against CVS HEAD.
I'm running Drupal 6 from CVS.

Comments

agentrickard’s picture

Thanks.

Add also -- notice: Undefined variable: extra in domain_content\domain_content.module on line 38.

pasqualle’s picture

Title: Fix two E_NOTICE (domain_get_user_domains for creating new user and $www_replaced) » PHP notices
StatusFileSize
new1.94 KB
pasqualle’s picture

StatusFileSize
new2.15 KB

another
notice: Undefined property: stdClass::$domain_site in domain\domain.module on line 935.

agentrickard’s picture

Status: Needs review » Fixed

Committed to HEAD.

pasqualle’s picture

Version: 6.x-2.0-rc5 » 6.x-2.0-rc6
Status: Fixed » Active

another one:

notice: Undefined variable: grants in domain.module on line 905.

displayed when listing nodes with views for every row in the view. I am not sure what should domain_node_grants() return in this case, empty array or something else?

agentrickard’s picture

We never initialize the $grants array, which should happen at line 834.

  $grants = array();

/me goes to turn on Coder module.

pasqualle’s picture

I don't think that coder module would help you to catch php notices, but using d6-dev or hacking common.inc (by removing E_NOTICE check) definitely helps.
more details here: #291026: change E_NOTICE to warning and allow selection of error level

agentrickard’s picture

agentrickard’s picture

Status: Active » Closed (fixed)