0

One of the guys here deleted a module folder, in error, from drupal 7 site using FTP (I know but it was a mistake).

the Commerce module was deleted. Now can not access the site at all as we are getting a fatal error Fatal error: Call to undefined function commerce_pricing_attributes_property_info_callback() in /var/www/sites/all/modules/contrib/entity/modules/field.info.inc on line 30

Anyone know how to correct it? line 30 is $callback($info, $entity_type, $field, $instance, $field_type);

The function in question is below

function entity_metadata_field_entity_property_info() {
  $info = array();
  // Loop over all field instances and add them as property.
  foreach (field_info_fields() as $field_name => $field) {
    $field += array('bundles' => array());
    if ($field_type = field_info_field_types($field['type'])) {
      // Add in our default callback as the first one.
      $field_type += array('property_callbacks' => array());
      array_unshift($field_type['property_callbacks'], 'entity_metadata_field_default_property_callback');

      foreach ($field['bundles'] as $entity_type => $bundles) {
        foreach ($bundles as $bundle) {
          $instance = field_info_instance($entity_type, $field_name, $bundle);

          if ($instance && empty($instance['deleted'])) {
            foreach ($field_type['property_callbacks'] as $callback) {
              $callback($info, $entity_type, $field, $instance, $field_type);
            }
          }
        }
      }
    }
  }
  return $info;
  • 1
    Can't you just upload Commerce module back, using FTP, just like it was deleted? – Mołot Mar 5 '14 at 10:10
  • Apologies, already did that – user001 Mar 5 '14 at 10:15
  • And it did not help? – Mołot Mar 5 '14 at 10:16
  • 1
    Nope, put them back and nothing, rebooted server, flushed caches and still the screen only shows this error. I can not access the admin screen from the web page, can only access everything now through the server terminal – user001 Mar 5 '14 at 10:24
  • 1
    New error from commerce_pricing_attributes_property_info_callback() - to - commerce_price_property_info_callback()...... regardless of resolving this or not. Thanks guys, I am always amazed by the amount of time that people take, to help others that they don't even know – user001 Mar 5 '14 at 10:45
0

If you have a backup this is the time to use it.

If not you should:

  1. Put your Site in maintenance mode from command line: https://drupal.org/node/590468 or by using Drush: drush vset maintenance_mode 1
  2. Replace the deleted module with exactly the same version in exactly the same place.
  3. Run update.php either from drush: drush updb or command line: https://drupal.org/upgrade/running-update-php
  4. All should be fine.

Please report back if this works or if another solution is found

  • I've done the second option and no luck so will just go with a backup. I was trying to avoid it as the work done back to that point was good progress. Ce la vie – user001 Mar 5 '14 at 11:25
  • Doing it whilst in maintenance mode does make a difference to how the database reacts to changes to the modules so it is worth performing the steps in the order proposed in the answer. Good Luck – Taylor Taff Mar 5 '14 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.