Needs review
Project:
Multifield
Version:
7.x-1.0-alpha1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Aug 2015 at 16:17 UTC
Updated:
15 Feb 2018 at 13:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
e0ipsoThe following patch solved the problem for me.
Comment #3
dmarkovic commented+1
Thanks e0ipso.
This patch is needed either when you're using drush, or backup&migrate module to restore database.
Comment #4
dave reidI'm very confused by this. If we've reached calling hook_init(), it would be correct to assume that all the modules have already been included/loaded by the bootstrap process. Why wouldn't multifield.module be loaded in that case?
Comment #5
e0ipsoI'm copy pasting the same as before because it also applies here.
I have not been using multifield for a while now, and details are pretty fuzzy but I was getting this pretty consistently. I'm sorry I cannot provide more context.
Thanks for looping back Dave I know it takes a lot of effort!
Comment #6
berliner commented@Dave Reid I'm confused as well by this, but I can confirm that this problem exists. It appeared in 2 out of 3 cases in our dev environments, but I couldn't figure out why it happened in general nor why it happened only in some of the environments but not in the others.
The patch in #2 is solving this problem for me too.
Comment #7
tatarbjHi all,
I've found out the real issue that throws this issue, let me explain it:
The real issue comes by the fact when the install file gets triggered the other files of the module is still not loaded (so issue can come when uninstallation happens incorrectly) and this implementation tries to use a function that is written in the .module.
Also there is the way how hook_field_schema() implementations are called, there are basically three cases:
- field_create_field -> It dedicatedly includes the install file of the module that defines the field_schema. In the scope of this call there is no other files included, so if the e.g. .module file is not included by something else, than you can meet similar issues. https://api.drupal.org/api/drupal/modules%21field%21field.crud.inc/funct...
- field_update_field -> The same case just like before, includes directly the install file. It's just fine as all the things that are usually implemented in the hook_field_schema() implementations are in the install files. Again: if there are things that are defined out of the install files, something else has to include the other files, otherwise we end up meeting the same issues. https://api.drupal.org/api/drupal/modules%21field%21field.crud.inc/funct...
- field_read_fields -> that's the one that you also can see in the stack above. This case does identically the same, including the install files. https://api.drupal.org/api/drupal/modules%21field%21field.crud.inc/funct...
Overall we can call this practice as a design, to call only the install files where the hook_field_schema() implementations are. But as nowhere else we get the installed full module with all its defined things in the memory, than if there is a thing that is defined outside of the module install file when it gets installed, then you have to include it manually as the patch does.
I hope I've been enough clear to describe the case why the install file defined more complex field_schema throws issues - we also experienced it when all files were on the right place, module was previously disabled but not properly unsintalled, so we had reference in the system table, but module didn't allow to go forward with simple cc all commands even, breaking the processes. So this extra line is very needed there in order to make it work in every cases.
Bests,
Balazs.