I tried to update the module to it's last version, but the database update does not work. I get the following message:

The following updates returned messages
office_hours module
Update #7100

    Failed: EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7671 of /var/customers/webs/pheonton/sightsrank/includes/common.inc).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

johnv’s picture

Title: Can't update to 7.x.1.2, dtabase update fails » Can't update to 7.x.1.2, database update fails

This is not necessarily an error of office_hours, see #2004698: error when updating from 7.x-1.1 to 7.x-1.2.

giorgio79’s picture

I cannot upgrade as well, although, my error looks different. Probably, I have too many nodes with office hours, and the update is not using batch api. Solved it by reinstalling the module as only one node had values.

-sh-4.1$ drush updb
The following updates are pending:

office_hours module :
  7100 -   Change value of 'day' column from 0-13 range to normal 0-6 day range.  This allows for more then 2 hours blocks per day.

Do you wish to run all pending updates? (y/n): y
PHP Fatal error:  Allowed memory size of 402653184 bytes exhausted (tried to allocate 81 bytes) in mydir/includes/entity.inc on line 1321

Fatal error: Allowed memory size of 402653184 bytes exhausted (tried to allocate 81 bytes) in mydir/includes/entity.inc on line 1321
Drush command terminated abnormally due to an unrecoverable error.   [error]
Error: Allowed memory size of 402653184 bytes exhausted (tried to
allocate 81 bytes) in mydir/includes/entity.inc,
line 1321
The external command could not be executed due to an application     [error]
error.
The command could not be executed successfully (returned: PHP Fatal  [error]
error:  Allowed memory size of 402653184 bytes exhausted (tried to
allocate 81 bytes) in mydir/includes/entity.inc
on line 1321

Fatal error: Allowed memory size of 402653184 bytes exhausted (tried
to allocate 81 bytes) in
mydir/includes/entity.inc on line 1321
, code: 255)
johnv’s picture

The hook_update is restartable.
I made a small change , so that empty fields are not updated. It should mean a performance improvement on installations like giorgio's (lots of nodes, few office_hours-content).

jackfoust’s picture

I'm having the same issue as the original poster. I applied the patch from commit a3ed801 with no luck.

I can tell you that my problem occurs on field_attach_load();

The following parameters are being passed.

field_attach_load('taxonomy_term',$full_entities,FIELD_LOAD_CURRENT,array('field_id' => '17'));
$full_entities print_r() = Array ( [1] => stdClass Object ( [tid] => 1 ) )

field_id 17 is office_hours field attached to my taxonomy_term of 'locations'

johnv’s picture

Title: Can't update to 7.x.1.2, database update fails » Can't update to 7.x.1.2 when office_hours attached to taxonomy_terms, database update fails
Status: Active » Fixed
FileSize
1.23 KB

This happens when the field is attached to taxonomy_terms and -in general- any entity type whose 'bundle' value is not stored in a '$entity->bundle' variable, but in another field, like '$term->vocabulary_machine_name'.

Attached patch is committed here.

The error is corrected in current -dev version or version 7.x-1.3 (when available).

jackfoust’s picture

7.x.1.3 resolved my issue. Thanks John!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.