Patch attached helps avoid the following notice:

Notice: Undefined index: machine_name in domain_tokens() (line 87 of domain/domain.tokens.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

agentrickard’s picture

Status: Needs review » Postponed (maintainer needs more info)

A notice which I have never seen. Steps to replicate, please.

agentrickard’s picture

Issue summary: View changes

Clarified description.

santoshm29’s picture

Issue summary: View changes

I am new to Drupal. I install the module to configure content for affiliate web sites

I am getting the same error.

How should I update this patch in Domain Access module? Appreciate steps in manually updating required files

will this patch remove the notice from admin pages.

agentrickard’s picture

I still need steps to repeat the issue, which I have never seen.

See https://drupal.org/contribute/testing for details about how to file a good bug report.

mark_anthony’s picture

I keep getting something similar:
Notice: Undefined index: machine_name in domain_tokens() (line 87 of /var/www/mysite/public/sites/all/modules/domain/domain.tokens.inc).

It worked on initial set up, then I started getting this message. I then updated to the latest Domain module. It worked for a while, then last night it started again.
It may have something to do with Domain Views.

I included the patch from above. I also went to Structure/Domains and edited the one extra domain there. really just clicked "Save Domain Record"

That had seemed to correct it, but only for an hour or so an now the same error.

agentrickard’s picture

PLEASE READ COMMENT #3.

At least give me a report of what you were doing, what page you were on, what you clicked in order to trigger the error.

mark_anthony’s picture

I would like to. I am just checking the sites front when I notice. The Views slideshows I have set up for both sites disappear, and the Site information gets mixed up or combined weirdly (don't have a good example of that-sorry).
It just seems to throw this error after a indefinite period. Clearing the sites cache corrects it for a period.
In my last attempt at correcting I went into Structure » Domains » Batch Updating and lowered Cache setting for all the domains to 3 hours.
(had to do this through the Batch tab as the setting would not stick in the Configuration » Development » Performance page for a particular domain.)
So far it has been about 24 hrs and no error yet and the two sites seem to be recognized as correctly different sites.

agentrickard’s picture

Thanks.

mark_anthony’s picture

OK it started again. Here is a list of all the Reports (that I can find) in reverse order (the top of the list happened first- like the same second) leading up to it .

  • Warning: include(/var/www/thefutureinreading/public/sites/all/themes/future2omega/templates/region--branding.tpl.php): failed to open stream: No such file or directory in theme_render_template() (line 1517 of /var/www/thefutureinreading/public/includes/theme.inc).
  • Warning: include(): Failed opening '/var/www/thefutureinreading/public/sites/all/themes/future2omega/templates/region--branding.tpl.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in theme_render_template() (line 1517 of /var/www/thefutureinreading/public/includes/theme.inc).
  • Warning: include(/var/www/thefutureinreading/public/sites/all/themes/future2omega/templates/region--menu.tpl.php): failed to open stream: No such file or directory in theme_render_template() (line 1517 of /var/www/thefutureinreading/public/includes/theme.inc).
  • Warning: include(): Failed opening '/var/www/thefutureinreading/public/sites/all/themes/future2omega/templates/region--menu.tpl.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in theme_render_template() (line 1517 of /var/www/thefutureinreading/public/includes/theme.inc).
  • Warning: include(/var/www/thefutureinreading/public/sites/all/themes/future2omega/templates/node.tpl.php): failed to open stream: No such file or directory in theme_render_template() (line 1517 of /var/www/thefutureinreading/public/includes/theme.inc).
  • Warning: include(): Failed opening '/var/www/thefutureinreading/public/sites/all/themes/future2omega/templates/node.tpl.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in theme_render_template() (line 1517 of /var/www/thefutureinreading/public/includes/theme.inc).
  • Warning: file_get_contents(sites/all/themes/future2omega/js/transit.js): failed to open stream: No such file or directory in drupal_build_js_cache() (line 4956 of /var/www/thefutureinreading/public/includes/common.inc).
  • Notice: Undefined index: machine_name in domain_tokens() (line 87 of /var/www/thefutureinreading/public/sites/all/modules/domain/domain.tokens.inc).

Maybe my theme templates are goofed and are hogging php or something. We have like 200mg to php.

mark_anthony’s picture

Another thing I have noticed, in Local (which works fine) as compared to Production Server (where the issue is)
PHP DOM extension Enabled - is on in local
and not showing in Status Report for Production Server install.

Is this needed?

mark_anthony’s picture

Well I think I fixed my issue, and it is totally unrelated to Token.
It seems that a Branding template I had modified to pull in an image did not have a correct path, or the path was causing the template to fail intermittently. Then a whole cascade of template fails would happen (even though the site would still render correctly!) and the domain access would bomb out.
I changed it so the image had a complete path instead of relative and I have not had a problem for at least a week.

Rory’s picture

See https://drupal.org/contribute/testing for details about how to file a good bug report.

@agentrickard: You're absolutely right, and I'm sorry for not including steps to reproduce.

In my defense the patch just fixes what appears to be an obvious issue, which is probably why I thought I could get off light on the report, but I can see how frustrating it is to let details slide.

With the latest version of Token and Domain when editing the admin field:
Structure > Domains > Settings > Show Domain-specific CSS classes
or navigating to:
admin/structure/domain/settings

You can see the field value contains an underscore, but the token suggestion provided below identifies this is incorrect! Refer to screenshot attached.

Sorry this hasn't been deaIt with on my part in some time and that I can't recall exactly how I was able to reproduce this in the first place, but hopefully that explains the issue and possibly how to reproduce it.