I upgraded from 3.5 to 3.7 no I'm getting the following error in the logfile.

Warning: array_flip() [function.array-flip]: The argument should be an array in domain_get_node_defaults() (line 4135 of /domain/domain.module)

That seems to refer to the following line in the module file.

$settings = array_flip(domain_default_node_access_settings($type));

I think something has gone wrong with the upgrade or previous attempt to upgrade,

Cheers Dan

Comments

agentrickard’s picture

Have you run update.php? That should be accounted for in domain_update_7308

danharper’s picture

Yes I have, I think this is due to a failed update in the past but I'm not sure.

I am competent at manually chainging the DB if required if I you can tell me what the structure should be as I think that is the problem (am I correct)

Fortunately this is a test installation which I built from my live installation to make sure the this and other modules upgraded correctly, so whatever the solution I will have to apply to live as well.

Thanks for the quick response.

Cheers Dan

agentrickard’s picture

I think you can just re-save these options from the 'Content defaults' screen. That should fix it.

/admin/structure/domain/nodes

danharper’s picture

Status: Active » Closed (fixed)

This solved the issue.

Cheers Dan

pfrenssen’s picture

Category: support » bug
Status: Closed (fixed) » Needs review
StatusFileSize
new1.46 KB

We are using continuous integration and I could repeat this problem 100%. It is not caused by failed updates but it is a bug in the Domain module.

The problem is caused by the domain module failing to remove the domain_node_{bundle} variables when a bundle is removed. These variables stay behind and are not updated by domain_update_7308(). This problem will occur on all websites that have ever removed a content type while the domain module was enabled.

This is how the variables would look on a site where the "News" content type was removed. domain_get_node_defaults() loops over these variables and cannot flip the news variable as it is not an array:

mysql> select * from variable where name like 'domain_node_%';
+----------------------------------+-------------------------------------------------------+
| name                             | value                                                 |
+----------------------------------+-------------------------------------------------------+
| domain_node_article              | a:1:{i:0;s:13:"DOMAIN_ACTIVE";}                       |
| domain_node_news                 | i:0;                                                  |
| domain_node_page                 | a:1:{i:0;s:13:"DOMAIN_ACTIVE";}                       |
+----------------------------------+-------------------------------------------------------+

Attached patch fixes the problem and contains and update hook that will clean up the stale variables.

agentrickard’s picture

Ah! This is the key point "This problem will occur on all websites that have ever removed a content type while the domain module was enabled."

Thanks.

pfrenssen’s picture

Version: 7.x-3.7 » 7.x-3.x-dev
Assigned: Unassigned » pfrenssen
Status: Needs review » Needs work

I have run our test suite overnight and was still getting these notices. I need to investigate a bit further.

pfrenssen’s picture

Assigned: pfrenssen » Unassigned
Status: Needs work » Needs review

The problem from #7 was not related to the patch. It was caused by a Feature that I forgot to update.

The patch from #5 fully solves the issue for us.

agentrickard’s picture

Status: Needs review » Fixed

Committed.

   269f50d..e9798d5  7.x-3.x -> 7.x-3.x

Status: Fixed » Closed (fixed)

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