Hello, I am testing this module with Drupal 7 and Domain Access module.

To switch my site from holding, I am clearing the 'Holding sites' text box. Once I do my site loads fine, but with the following error:

Notice: Undefined index: argc in holding_boot() (line 32 of C:\xampp\htdocs\sites\all\modules\holding\holding.module).

To work around, I disable the module completely and re-enable as needed. As a feature it would be nice to have a basic switch 'on' or 'off' setting?

Cheers for the work on this!
Tim

CommentFileSizeAuthor
#5 1092230.holding.is_cli.patch327 bytesjoachim

Comments

joachim’s picture

Status: Active » Closed (won't fix)

> As a feature it would be nice to have a basic switch 'on' or 'off' setting?

That's on the modules page ;)

Tim Jones Toronto’s picture

OK.

What was the problem with Undefined index: argc in holding_boot() ?

joachim’s picture

Status: Closed (won't fix) » Postponed (maintainer needs more info)

Were you getting that only when trying to clear the holding sites setting?

Tim Jones Toronto’s picture

On first install of the module I didn't check the site as I went straight to the holding admin page to enter into holding mode.
On entering 'default' it works fine for a holding site.
To enable the sites (off hold), I cleared the box and site gives error I reported.

Today with more time I did a quick debug:

php_sapi_name() is ‘apache2handler’
$_SERVER['argc'] is NOT set.

Would this new API function be more helpful for version 7 (with isset part)?:

drupal_is_cli:

http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/drupal...

Thanks.

joachim’s picture

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

Oh yes, that would be rather handy! Thanks for the tip, I didn't know about that one :D

Can you try this patch and see if it fixes the error message?

Tim Jones Toronto’s picture

Hi,

Yes, meant to add this to you earlier - just wanted to double check with you suitability on D7 function :)

Patch works fine with my configuration; however I do not have Drush to 'Allow drush through' and test.

The problem does seem fixed with !isset logic added in the D7 API function.

Thanks for this module!

Tim

joachim’s picture

Ok will give it a spin with drush when I have time.

Thanks for testing it :)

joachim’s picture

Just got round to trying this for myself, and I can't reproduce your error message at all -- you're not on some wacky webserver like IIS are you?

Tim Jones Toronto’s picture

IIS works fine ;) and am using latest 'wacky' Apache server to get error ... :P

Being serious, maybe something in XAMPP configuration - not sure.

Anyway, the '!isset($_SERVER['SERVER_SOFTWARE'])' in the D7 API function logic fixes. You could double-check over at the Drush group etc.

joachim’s picture

Status: Needs review » Needs work

I'm not convinced this works:

|| (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0))

On a web page I am seeing $_SERVER['argc'] set to 1.