Upgrading to Skinr 6.x-2.x-dev from 2010-Jul-11 kills my site, including the admin area, with the following fatal error:

Fatal error: Call to undefined function skinr_fetch_config() in /var/www/drupal/sites/all/modules/skinr/skinr_ui.module on line 317

How do I continue?

Thanks & greetings, -asb

Comments

asb’s picture

Similar error messages, but different cicumstances:

#732804: Better to rename it as Error Description: 404: Not Found (initial title: "Fatal error: Call to undefined function skinr_fetch_config()")

The code from skinr_ui.module around line 317 is:

/**
 * Implementation of hook_form_alter().
 */
function skinr_ui_form_alter(&$form, $form_state, $form_id) {
  $skinr_config = skinr_fetch_config();
  $info = skinr_skin_data();
...
nscad_nathan’s picture

Same problem here! I followed the steps in http://groups.drupal.org/node/53798. Rolling back to 1.X fixes issue.

asb’s picture

Anyone?

asb’s picture

Since the maintainer/s seem/s not to read the issue queue, II posted a question in the Skinr group.

stephthegeek’s picture

Status: Active » Postponed (maintainer needs more info)

Can you provide a bit more information about your setup? What modules are you using? Anything in the logs?

The error occurs on any page load when you enable the module? Have you tried running update.php, or completely uninstalled and reinstalled the module?

asb’s picture

I can not access the logs since the site is dead, as I wrote, including the admin area.

Obviously I haven't added any modules since the site is dead; the only thing that changed is the last code update three weeks ago. So most probably there is a connection between the applied changes to Skinr and this issue.

Installed modules:

about_this_node   date             globalredirect         memcache         nodereference_views  recent_changes  taxonomy_defaults  update_advanced
admin             dialog           google_analytics       menu_breadcrumb  nodereferrer         scanner         taxonomy_manager   views
advanced_help     editablefields   image                  menutrails       noderelationships    search404       taxonomy_switch    views_attach
ajax_load         edit_term        javascript_aggregator  mimedetect       nodewords            simpletest      taxonomy_vtn       views_bulk_operations
auto_nodetitle    ed_readmore      jquery_ui              modalframe       notify               site_map        term_display       wikitools
cck               filebrowser      jquery_update          modr8            openlayers           skinr           term_merge         xmlsitemap
content_taxonomy  filefield        link                   moduleinfo       openlayers_geocoder  spamspan        token
createfromweb     filefield_paths  logintoboggan          mollom           panels               synonyms        total_control
css_gzip          flag             masquerade             mp3player        pathauto             systeminfo      transliteration
ctools            getid3           mediawiki_filter       node_clone       path_redirect        tagadelic       twitter

Not all of them are enabled, about the status of 'css_gzip' and 'javascript_aggregator' I'm not sure since there were issues with panels and caching/aggregation.

"Kills my site" means that there is nothing but this error message, anywhere. No page is loading without this error, including the admin area.

Running the web-based update.php results in an error. Which one it is you might have guessed by now. But yes, the file update.php loads indeed without giving the error. However, putting an $update_free_access = TRUE; into ./sites/default/settings.php and then clicking on "Continue" produces it.

No, I have not completely uninstalled the module since this would mean that I loose all layout definitions and formatings, as far as they're based on Skinr. I was hoping for some kind of advice or a quick fix for the "undefined function", at least when I wrote this issue.

OK, now to what Drush tells me:

Running update.php from the shell:

# drush updatedb
No database updates required                                                                                                                      [success]
Finished performing updates.

Listing watchdog messages:

# drush wd-list
(...)
[6] : php
(...)
 8245  04/Aug 22:15  error  php  Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback,
                                 'clone_access' was given in _menu_check_access() (line 452 of /var/www/a
 8241  04/Aug 20:07  error  php  Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback,
                                 'clone_access' was given in _menu_check_access() (line 452 of /var/www/a
 8224  04/Aug 03:30  error  php  Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback,
                                 'clone_access' was given in _menu_check_access() (line 452 of /var/www/a
 8210  03/Aug 15:59  error  php  Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback,
                                 'clone_access' was given in _menu_check_access() (line 452 of /var/www/a

Getting rid of Skinr:

# drush dis skinr
The following projects will be disabled: skinr, skinr_ui
Do you really want to continue? (y/n): y
skinr was disabled successfully.                                                                                                                  [ok]
skinr_ui was disabled successfully.

The site is back, of course without the eye candy provided by Skinr.

And back to square 1:

# drush en skinr
The following projects will be enabled: skinr
Do you really want to continue? (y/n): y
skinr was enabled successfully.                                                                                                                   [ok]
# drush cc
Enter a number to choose which cache to clear.
  [0] : Cancel
  [1] : all
  [2] : theme
  [3] : menu
  [4] : css+js
1
'all' cache was cleared
moonray’s picture

Can you check skinr.module and make sure the skinr_fetch_config() function exists?

If it does (which it should), it means that your drupal setup is somehow not including skinr.module file when trying to execute the skinr_ui_form_alter() function in skinr_ui.module. WHY that's happening is a mystery to me right now.

asb’s picture

Yes, the file skinr.module from the installed 6.x-2.x-dev has this:

...
/**
 * Fetch Skinr configuration data from modules.
 */
function skinr_fetch_config() {
  static $cache = NULL;

  if (is_null($cache)) {
    $cache = module_invoke_all('skinr_config');
    foreach (module_implements('skinr_config_alter') as $module) {
      $function = $module .'_skinr_config_alter';
      $function($cache);
    }
  }

  return $cache;
}
...

(Skinr 6.x-1.x doesn't have skinr_fetch_config(), right?)

asb’s picture

Ah, I see, it's your code. OK, I understand that most probably there won't be a quick fix if you have no idea what might be wrong.

I'll do now what I should have done a long time ago: Fall back to the last working backup (which is running the last dev release before the broken one from 2010-Jul-11).

However, thank you for looking into this!

asb’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Done, Went back to the last backup, and everything is working again.

ChrisBryant’s picture

@asb, thanks for the heads up and following up and closing this issue. It's good to hear you were able to get it working again!

mlncn’s picture

I received the same error. I think the real reason may be using drush to update–
Using Drush to update skinr resulted in a botched *downgrade* from the recommended new dev 2.x release shown on the update status page to the staple 1.x release. Furthermore it seems drush did not delete old files, so the 2.x skinr_ui stayed around. Enabling that was naturally fatal.

ChrisBryant’s picture

That's great to hear, thanks for the confirmation Benjamin!

dillonm’s picture

Kind of along the lines of Benjamin ... when upgrading Skinr, I get this error on sites only when I don't delete the 1.x version before installing the new version of skinr.

drush dis skinr skinr_ui
rm -rf sites/all/modules/skinr
drush dl skinr-6.x-2.x-dev
drush en skinr skinr_ui
drush updatedb

Seems to work for me. Also, don't forget to install the various necessary jquery/dialog modules noted here http://groups.drupal.org/node/53798

asb’s picture

Unexpected downgrades through Drush happen all the time - so keep in mind to always compare what branch you're running and what Drush tried to install. This applies also to almost all dev releases you might be running (boost, image...), Drush will always try to downgrade to the "latest" release marked as "stable". In most cases this is unwanted, so beware.

asb’s picture

I was just bitten by this again and can confirm the Drush problem (#12).