Download & Extend

Constants should be checked if defined before being set

Project:Domain Access
Version:7.x-3.5
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

Some settings like DOMAIN_INSTALL_RULE or DOMAIN_SITE_GRANT need to be modified in the domain.module to take effect. In my opinion, these constants should be overridden in Drupal settings.php, so that we don't need to change the module's source code. If so, we don't need to modify the source whenever the module is upgraded to newer version.

Just modify the domain.module like below:

<?php
if (!defined('DOMAIN_INSTALL_RULE'))
  
define('DOMAIN_INSTALL_RULE', TRUE);
?>

Comments

#1

Makes sense to me. We really need to phase these out, actually.

Can you roll patches against the 3 active branches, please.

#2

Here are the patches for all 3 branches

AttachmentSize
domain.module-6.x-2.x-dev.patch 1016 bytes
domain.module-7.x-2.x-dev.patch 1015 bytes
domain.module-7.x-3.x-dev.patch 1012 bytes
domain.module-7.x-3.6.patch 1015 bytes

#3

Status:active» needs work

Nice. But Drupal convention is never to use one-line IF statements.

nobody click here