I added the following condition as php code:
<? $_GET["theme"]=="garland";?>
and now I get this message and it stays in the virtual site, doesnt go back to the original site.
Notice: Undefined index: operator in virtual_site_condition_php() (line 104 of C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\pn\sites\all\modules\virtual_site\condition\virtual_site_condition.basic.inc).
Comments
Comment #1
reswild commentedDon't you need to actually return a value here? Like:
Another thing is that PHP conditions are still broken in the stable release for D7. I can see that it has been fixed in the dev version for some time, but it would be good to roll out a new version for this, as this is something that is likely to take down your whole site.
Comment #2
lemagus commentedI had the same problem I think it's because of PHP 5.4
Anyways here something that worked for me :
Replace :
return ($context['operator'] == CONDITION_SKIP || !$context['code'] || (module_exists('php') && php_eval($context['code'])));Line 104 in /sites/all/modules/virtual_site/condition/virtual_site_condition.basic.inc with :
return ( (!empty($context['operator']) && $context['operator'] == CONDITION_SKIP) || !$context['code'] || (module_exists('php') && php_eval($context['code'])));Cheers
Comment #3
adamps commentedIt looks to me as if the problem is that the PHP form doesn't have the operator section on it. However the code that evaluates the condition assumes the operator is set.
So the fix is to virtual_site_condition_php_form, add
$form['pages_operator'] = array(
etc.
I'll try and get a fix posted for this some time.
Comment #4
adamps commentedComment #6
adamps commented