Closed (fixed)
Project:
Date
Version:
7.x-3.x-dev
Component:
Date API
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Dec 2018 at 00:58 UTC
Updated:
26 Sep 2022 at 20:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
steinmb commentedComment #4
steinmb commentedPlaced the new includes directory in the wrong module directory. This put it inside Date API directory. Let us try this one more time then.
Comment #6
steinmb commentedNot sure about the failing test. DateNowUnitTestCase extends DrupalUnitTestCase - It does not create/use a db. nor file - https://api.drupal.org/api/drupal/modules%21simpletest%21drupal_web_test... and I cannot re-produce it locally.
Comment #7
steinmb commentedSince I am unable to re-produce locally do I just have to guess. Perhaps https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drup... get called and then It try to use the registry to autoload the Class?
Comment #8
steinmb commentedPatch reroll
Comment #10
steinmb commentedDoh, wrong patch.
Comment #11
steinmb commentedUpdated IS. Manual re-roll. Lets see if we broke something. Lots of tests and test-structure have changed since I originally rolled this but this change is as small as possible, move the class out, no other changes.
Comment #13
steinmb commentedNo, it looks like test-bot fail the same place as 3 years ago (#6). @DamienMcKenna you might know why this is?
Adding back the fix from #7 but I am not sure I like it.
Comment #14
damienmckennaIf you look at the docs for drupal_load() it only loads the main file for that item - it doesn't load the full module's dependencies, include files or anything else. So this is by design. It might be cleaner to move the manual require_once() to after the drupal_load() and to document the issue there, so others will know why it's written this way.
Comment #15
steinmb commentedYou are right. Looking at DrupalUnitTestCase:setUp() have actually document this:
Does not this mean that we do no not need the drupal_load() ? - Unit tests locally worked just fine without it.
Comment #17
steinmb commentedOh well, test bot seems to need it for something...
Comment #18
steinmb commentedI can re-roll this for 7.x-3.x if there is any interest getting this housekeeping change in?
Comment #19
damienmckennaUltimately yes I'd like to include this change, a reroll would be appreciated. Thank you.
Comment #20
solideogloria commentedRerolled for 3.x. Please review and test.
Comment #21
solideogloria commentedFix tests.
require_once './' . drupal_get_path('module', 'date_api') . '/includes/DateObject.php';Comment #22
solideogloria commentedI don't know why it can't open the file... anybody know what's wrong?
Comment #23
damienmckennaYour patches are missing the new file.
Comment #24
solideogloria commentedD'oh. I added the file.
Comment #26
damienmckennaThanks!
Comment #27
damienmckennaComment #28
solideogloria commentedI forgot about this quirk, but after updating I get
A cache clear (in an update hook) is required to fix the issue.
Comment #29
damienmckennaDid you not clear the caches after updating the site to alpha2? I can just update the release notes and leave it at that, it's just an alpha release so that's sufficient for now imho.
Comment #30
solideogloria commentedMmk.
Comment #31
damienmckennaThanks for being through, I do appreciate it.
Comment #32
solideogloria commentedI have no idea what caused it, but when I merged alpha2 into my project, I received this error:
However, clearing cache and registry rebuild had already been performed. The error also only happened for me in a non-private browsing window on my current device. I had to clear my browser's cache to fix it.
I doubt there's anything that needs to be done in code. I just wanted to post this here in case someone else has the same issue. I only had it for one branch, too. I had tested it successfully in dev/staging, so there's no way I can reproduce it.
Comment #33
damienmckennaThanks for the extra details. That is weird. I've ran into occasional problems with what appears to be the nfs connection in ddev not quite working correctly and an old file getting "stuck", it didn't fix itself until I restarted ddev.
Comment #34
solideogloria commentedI found a way to reproduce the error reliably. Once I view a certain page, the entire site becomes unviewable (for only me) until I clear my browser's cache.
I'm going to reopen this issue and begin posting debug information I discover.
Comment #35
solideogloria commentedNote that this error is different than the other one I shared above, but this is the one that is showing and reproduceable.
I also get this (This is due to a bootstrap error, I realized):
Basically, I get ONE view of the page in question, and after I view it once, viewing any page on the site will throw the above fatal errors. The page in question is a view. My guess is that something gets saved to the session, (I saw stuff about views filters, I think, perhaps remembering which ones are selected?), and once that happens, it cannot be unserialized when loading the session?
Is it possible that the
DateObjectclass is not properly (un)serializable?Comment #36
solideogloria commentedRelevant code:
Comment #37
solideogloria commentedI placed a breakpoint earlier, and I confirmed my suspicions, as the root exception being thrown is:
I tried removing the serialization code from
DateObject, and I no longer experience the problem. The code itself says this:But looking at the linked PHP bugs, built-in PHP objects are serializable as of PHP 5.3. Since we don't need to support < PHP 5.3, I'm going to recommend that we remove this code and use the native serialization. I'll create a separate issue and link it here.
Comment #38
solideogloria commented#3309290: Invalid serialization data for DateTime object; Remove support for PHP < 5.3