Closed (fixed)
Project:
Doubleclick for Publishers (DFP)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jun 2015 at 03:48 UTC
Updated:
17 Apr 2017 at 13:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
robloachEven while the module is enabled.
Comment #2
robloachComment #3
robloachComment #4
robloachComment #5
bleen commentedThis seems reasonable... lets let this marinate for a bit though to see if anyone has some other thoughts
Comment #6
pachabhaiya commentedThe patch #4 helps site from breaking if entity_modified module is not installed.
The watchdog() function format does not look good.
Also,
I don't understand the way $key variable is used.
static $key = 1000;
return (string)$key++;
$key++ will always return 1001.
Comment #7
pachabhaiya commentedI've made some corrections in patch #4 and uploaded it.
Similar to what entity_modified module has done here, http://cgit.drupalcode.org/entity_modified/tree/entity_modified.module?i...
we could just return "1" if the entity_modified module is not found.
Comment #8
jmev commentedI actually experienced this when importing a database from a production site to a local site. I checked the database and found that the module was enabled, so assumed it to be a caching issue. Clearing caches resolved my issue. Posting this in case someone else experiences the error under similar circumstances.
Comment #10
rwohlebThese patches don't cover the case where the entity_modified module exists in the filesystem but has yet to be installed. The call to module_load_include() doesn't do any checks that the module is enabled and blindly loads that file, which seems pretty dangerous. As a result you will get a PDOException if the table is missing.
Comment #11
rwohlebHere is a patch that avoids trying to load the module file directly. It's either there and enabled, or it's not. If for some reason this function is being called before the entity_modified module is initialized by core, then that seems like a separate issue.
Comment #12
fabianx commentedHi there,
Here is the author of entity_modified. I also originally worked with Crell in IRC on the caching part of dfp.
What needs to happen here is that you disable the caching if entity_modified_last function does not exist and you probably don't want to spam watchdog with messages either to avoid breaking sites. I suggest to add hook_requirements error.
On the other hand it is a clear dependency, so maybe a fatal (as is now) is also fine.
But do not just return 1, because that means your token cache won't be updated in case that you update any referenced node or user.
Comment #13
marcelovaniI think since the module is required as dependency in the info file, it cannot be optional
In other words, if we want to use #11, we need to remove the dependency from the info file.
alternatively, we can simply enable entity_modified in a hook_update()
I am still not sure I would like to have the second option, because we don't have a need to "cache all things"
Comment #14
marcelovaniOk, here is my solution:
Please review and let me know if I forgot anything
Comment #15
marcelovaniComment #17
marcelovaniI forgot to enable the module during the tests
Comment #18
marcelovaniOne last thing
Comment #19
bleen commentedCan we disable this if Entity Modified is not enabled?
This can be 1 if statement
Comment #20
marcelovaniGood idea
Comment #21
bleen commentedThis looks pretty good to me now .... anyone else want to kick the tires?
Comment #22
anybodyLooks good! +1 for RTBC
Comment #24
bleen commentedComment #25
anybodyA new stable release would be nice because the last stable is broken due to this error for me.
Thank you!
Comment #26
marcelovaniHold on, I think setting the setting to be disabled when entity_modified is causing a problem.
Because the default value of variable_get("dfp_token_cache_enabled", TRUE) is True, we have a situation where the box is ticked but the form validation fails.
I think we could change the default value to FALSE when the module is not enabled, but when enabled, get the value from the variable as usual
Comment #27
marcelovaniSorry about re-opening this, I just realized the problem with disabling the option after it was already committed
Comment #28
bleen commentedGrrrr ... because the value of a disabled form element is sent anyway. Sigh.
This looks like the correct solution to me but havent had a chance to actually test. Will try later today, but if someone else has a minute that would be great
(nice catch @marcelovani)
Comment #30
bleen commented