It's because _element_info returns NULL and drupal_prepare_form() doing: $form += _element_info('form'); (and += working only for the same types).

Problem:

  $form += _element_info('form');

want to add new array element and expecting array as result.

Why _element_info returns NULL

function _element_info($type, $refresh = NULL) {
  static $cache;
...
  if (!isset($cache) || $refresh) {
    $cache = array();
    foreach (module_implements('elements') as $module) {
      $elements = module_invoke($module, 'elements');
      if (isset($elements) && is_array($elements)) {
        $cache = array_merge_recursive($cache, $elements);
      }
...
  return $cache[$type];

If none of the modules implement hook_elements, $cache is empty and there is Fatal error.
I'm not sure when exactly does it happen, but it happen especially when static $cache is not defined (could be during shutdown), it's even not initiated so have unknown type.

CommentFileSizeAuthor
#7 patchdone.jpg55.8 KBSoCalCreations
#1 form.patch300 byteskenorb

Comments

kenorb’s picture

Status: Active » Needs review
StatusFileSize
new300 bytes

Patch attached.

SoCalCreations’s picture

I am getting this error on my site when I go to the /user screen to try to log in. The home page is nothing but my offline message and no theme and the "user/1" page is the garland theme with the offline message. I am totally CONFUSED, can any one offer direction?

Thanks in advance
William

kenorb’s picture

Related issue: #565968: upgraded and site hosted

Please apply #1 patch and test it.
Or try 2b solution from http://drupal.org/node/482956

SoCalCreations’s picture

I Don't get it, how is the patch applied, it's not an executable and I am not sure where the code goes, can you be more specific?

I don't see how 2b applies and in any case then next solution down is how I got to this page to ask for help.
UPDATE I did go through and rename each module I had updated by placing an underscore behind the directory name. I then did it to several other modules, but nothing happened to make the following go away.

I keep getting the WSOD with the error, when I go to the login page of /user
Fatal error: Unsupported operand types in /home2/socalcre/public_html/includes/form.inc on line 511

UPDATE I found http://drupal.org/node/332619
However this isn't the issue either, the permissions are correct and the status of the module in the db is also correct according to this article.

kenorb’s picture

You can apply patch manually.
Edit file: includes/form.inc in your Drupal dir
and change line as it's with minus, to this with plus as here:
http://drupal.org/files/issues/form_28.patch

It's around 1366 line in form.inc.
Replace:

  return $cache[$type];

with:

  return (array)$cache[$type];

The error should be fixed.

SoCalCreations’s picture

StatusFileSize
new55.8 KB

Kenorb,

I applied the patch as you can see from the attached image, however my site is still not coming up.

http://www.socalcreations.net <- no theme, but offline message
http://www.socalcreations.net/user <- blank screen
http://www.socalcreations.net/user/1 <- themed offline message

Any further ideas?
Thanks for the continued assistance, it is very much appreciated.

kenorb’s picture

Probably you have some other conflict or problems with your modules.

Please install:
www.drupal.org/project/dtools
And execute .../dtools/wsod/wsod_emergency.php?q=user (followed by correct path of your module dir)
And check what's the message.

SoCalCreations’s picture

Okay I have done that and I get back something that may mean something to you, but just causes me to raise and eyebrow

hook_exit wasn't executed properly at , possible unexpected exit()/die()
Backtrace:

hook_exit wasn't executed properly at , possible unexpected exit()/die()
Backtrace: wsod_sess_close(:);session_write_close(:);

Got any clue What this means?

I also read that I could edit the "settings.php" file and set the
$update_free_access = FALSE;
TO
$update_free_access = TRUE;
To try to run the update.php, however it seems the update does not execute and the file automatically gets rewritten with the "FALSE" setting AND I still have a WSOD.

kenorb’s picture

Possible unexpected exit()/die() that means that some module probably have some bug and it terminate the whole website.
If you will send me prv or dump of the whole website, I can debug it why it's terminating in this place.

SoCalCreations’s picture

What is a PRV?
and Define Dump of the whole site.

I would be more than happy to send you anything, please contact me at william@socalcreations.net with your specific requirements.
thanks very much!

kenorb’s picture

Probably your issue is because of that error:

Fatal error: Call to undefined function filter_xss_admin() in /home2/socalcre/public_html/includes/common.inc on line 343

Follow those issues:
http://drupal.org/node/279450
http://drupal.org/node/112884
or raise the new support issue, because now it's not related to current one anymore and send me the link.

Possible solution:
- Check if you have existing modules/filter/filter.module file
- If you have no duplicated of that filter module

If you have access to phpMyAdmin, you can execute this query to switch off Offline mode:

UPDATE variable SET value = 's:1:"0";' WHERE name = 'site_offline'
SoCalCreations’s picture

Using the idea from post http://drupal.org/node/112884, which was to Open up update.php and uncomment-out
ini_set('display_errors', FALSE);

I set this to TRUE and got the following error now

Fatal error: Call to undefined function db_is_active() in /home2/socalcre/public_html/includes/bootstrap.inc on line 440

I am currently downloading the site, compressing its' files and will email you the link to download for further assistance.

I really appreciate your help
Will

kenorb’s picture


Ok, you have missing theme directory in your Drupal root directory.
Please download again Drupal sources and replace all the content that you have in Drupal archive.

You have disabled system module.
Try this query:

UPDATE system SET status = 1 WHERE name = 'system';
Anonymous’s picture

Status: Needs review » Closed (cannot reproduce)