πŸ‡ΊπŸ‡ΈUnited States @tawellman

Account created on 24 April 2009, almost 16 years ago
#

Recent comments

πŸ‡ΊπŸ‡ΈUnited States tawellman

We also had this problem, MR 27 fixed it.

Thank you!!

πŸ‡ΊπŸ‡ΈUnited States tawellman

I just got this on 10.2 and everywhere I went the same WSOD Warning popped up.

Ran command: composer update -W

It went away. Everything back to normal.

πŸ‡ΊπŸ‡ΈUnited States tawellman

I have search a bunch. Any suggestion on what to be looking for? Am I using the wrong terminology?

πŸ‡ΊπŸ‡ΈUnited States tawellman

Ok, I think I may have finally figured it out. The Rules CurrentDateContext.php is saving the DateTime in your current timezone and not in a UTC without applying the Mountain Time (or any other specific timezone) adjustment.

So I hacked the code, with a little trial and error I got the following to work...

namespace Drupal\rules\ContextProvider;

use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Plugin\Context\Context;
use Drupal\Core\Plugin\Context\ContextDefinition;
use Drupal\Core\Plugin\Context\ContextProviderInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Datetime\DrupalDateTime;

class CurrentDateContext implements ContextProviderInterface {
  use StringTranslationTrait;

  protected $datetime;

  public function __construct(TimeInterface $datetime) {
    $this->datetime = $datetime;
  }

  public function getRuntimeContexts(array $unqualified_context_ids) {
    // Get the current Unix timestamp
    $timestamp = $this->datetime->getCurrentTime();

    // Create a DrupalDateTime object from the timestamp in UTC
    $dateTime = DrupalDateTime::createFromTimestamp($timestamp, new \DateTimeZone('UTC'));

    // Format the DateTime object to an ISO 8601 string in UTC
    $formattedDateTime = $dateTime->format('Y-m-d\TH:i:s');

    // Create the context with the formatted date time in UTC
    $context_definition = new ContextDefinition('string', $this->t('Current UTC date'));
    $context = new Context($context_definition, $formattedDateTime);

    $result = [
      'current_date' => $context,
    ];

    return $result;
  }

  /**
   * {@inheritdoc}
   */
  public function getAvailableContexts() {
    return $this->getRuntimeContexts([]);
  }

}

I am just useful enough to get myself in trouble. So creating a patch is above me. I hope someone can make that happen. I will check back and create a new issue that is more direct if I need to.

πŸ‡ΊπŸ‡ΈUnited States tawellman

For anyone else having troubles figuring this out. The Date/Time field is saved in this format: 2024-01-20T07:01:53

To get it to work, for me, I had to set up a Date Format in Configuration > Region and language > Date and time formats

I set the Name to 'Rules Format' and the Format String to 'Y-m-d\Th:m:s'

In the Rules Actions, 'Add action' of 'Set a Data Value'

Use the Data selector to pick your Entity and add a period '.' to get your field to show. Example: wo_time_clock_created.field_start_time

In the Value field, as described above, enter the token with brackets. Just add your new Date Format.

{{@rules.current_date_context:current_date | format_date('rules_format')}}

I am sure there may be a better way to do it but I got it to work. The documentation about this sure needs some help.

πŸ‡ΊπŸ‡ΈUnited States tawellman

I think I figured it out. Looks like maybe the arguments in lines 23, 32, and 45 are in the wrong order. Changed them to the following and things look to be working.

23    $event_dispatcher->dispatch($event, UserFlaggedEvent::EVENT_NAME);

32  $event_dispatcher->dispatch($event, "rules_flag_entity_flagged:$entity_type");

45  $event_dispatcher->dispatch($event, "rules_flag_entity_unflagged:$entity_type");

I know just enough to be a little useful sometimes. Never wrote a patch, so if someone could handle that end, that would be cool!

Hope this helps!

πŸ‡ΊπŸ‡ΈUnited States tawellman

I am getting the same thing. Is there a patch I am missing?

The website encountered an unexpected error. Try again later.

TypeError: Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch(): Argument #1 ($event) must be of type object, string given, called in /home/sewardsdevel9/sewards10/web/modules/contrib/rules_flag/rules_flag.module on line 45 in Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (line 89 of core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php).

rules_flag_flagging_delete()
call_user_func_array() (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 215)
Drupal\Core\Entity\EntityStorageBase->invokeHook() (Line: 900)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook() (Line: 462)
Drupal\Core\Entity\EntityStorageBase->delete() (Line: 753)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete() (Line: 360)
Drupal\Core\Entity\EntityBase->delete() (Line: 344)
Drupal\flag\FlagService->unflag() (Line: 116)
Drupal\flag\Controller\ActionLinkNoJsController->unflag()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 50)
Drupal\ban\BanMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

I am on:

  • Drupal 10.2.2
  • Rules 8.x-3.0-alpha8+2-dev
  • Rules Flag 1.0.2+1-dev

I install the Rules flag module and try to flag an ECK entity and get the above WSOD error. Refresh the screen and entity displays fine and is flagged like it should be. When I unflag it, error shows back up. NO rules written yet. Example Rules have also been disabled.

Uninstall the module and flagging works a designed.

I am migrating a site that relied a lot on Rules and Flags. Is there any chance someone can help me find a solution?

πŸ‡ΊπŸ‡ΈUnited States tawellman

I ran into something similar. Did you ever find a solution?

πŸ‡ΊπŸ‡ΈUnited States tawellman

I recently updated to 10.2 and am now getting the following on any Entity Manage form display pages.

Deprecated function: strnatcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated in Drupal\Core\Layout\LayoutPluginManager->Drupal\Core\Layout\{closure}() (line 204 of core/lib/Drupal/Core/Layout/LayoutPluginManager.php).

Drupal\Core\Layout\LayoutPluginManager->Drupal\Core\Layout\{closure}(Object, Object)
uasort(Array, Object) (Line: 207)
Drupal\Core\Layout\LayoutPluginManager->getSortedDefinitions(Array, 'label') (Line: 217)
Drupal\Core\Layout\LayoutPluginManager->getGroupedDefinitions() (Line: 230)
Drupal\Core\Layout\LayoutPluginManager->getLayoutOptions() (Line: 64)
Drupal\field_layout\Form\FieldLayoutEntityFormDisplayEditForm->form(Array, Object) (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('entity_form_display_edit_form', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Deprecated function: strnatcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated in Drupal\Core\Layout\LayoutPluginManager->Drupal\Core\Layout\{closure}() (line 204 of core/lib/Drupal/Core/Layout/LayoutPluginManager.php).
Deprecated function: strnatcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated in Drupal\Core\Layout\LayoutPluginManager->Drupal\Core\Layout\{closure}() (line 204 of core/lib/Drupal/Core/Layout/LayoutPluginManager.php).
Deprecated function: strnatcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated in Drupal\Core\Layout\LayoutPluginManager->Drupal\Core\Layout\{closure}() (line 204 of core/lib/Drupal/Core/Layout/LayoutPluginManager.php).
Deprecated function: strnatcasecmp(): Passing null to parameter #1 ($string1) of type string is deprecated in Drupal\Core\Layout\LayoutPluginManager->Drupal\Core\Layout\{closure}() (line 204 of core/lib/Drupal/Core/Layout/LayoutPluginManager.php).

I have searched for a solution. I can confirm the patch from #25 worked for me.

πŸ‡ΊπŸ‡ΈUnited States tawellman

I recently updated to 10.2 and am getting the same error.  This lead me to a possible solution. 

πŸ‡ΊπŸ‡ΈUnited States tawellman

I uninstalled it and reinstalled with Drush. Then updated it with composer. It looks like that did the trick. Clearing caches the other day did not do it.

Sorry I forgot to update this issue yesterday.

πŸ‡ΊπŸ‡ΈUnited States tawellman

I can confirm that this is in fact the case with A2Hosting. I also got reliant on their "Server Rewind" utility, and have had a couple issues with the "Jetbackup 5" program not backing up key files. The site I am currently working on also relies on a symlink that gets deleted when I use their Restore.

Today was the first time I ran into this particular problem. Lost several hours of progress because of it and the Serial module. Lessons learned!

Thank You @bas123 for posting this! It helped me find the files that A2Hosting was blaming me for loosing.

πŸ‡ΊπŸ‡ΈUnited States tawellman

Tried to delete the field and then the bundle. Got the same WSOD "The website encountered an unexpected error. Try again later."

Then tried to uninstall the module and got the same error pages.

πŸ‡ΊπŸ‡ΈUnited States tawellman

Thank You @wxman, Have been fighting this upgrade for a couple days now and now down to a psr/log hang up.  So much for easy upgrades!

It was Drush for me that was holding up the upgrade of psr/log (3.0.0).  Updating to 12 helped.

I have to applaud you for spelling out this sequence in simple straight forward steps and including the permissions commands.  I wish I would have found this earlier!

πŸ‡ΊπŸ‡ΈUnited States tawellman

Thank You @vensires!! That made it easy!

πŸ‡ΊπŸ‡ΈUnited States tawellman

Is there an estimated release date for the D10 version of this module?

πŸ‡ΊπŸ‡ΈUnited States tawellman

Is this a obsolete since the issue in 10.1 has been fixed with CKEditor 5?

πŸ‡ΊπŸ‡ΈUnited States tawellman

This was a quick fix!

πŸ‡ΊπŸ‡ΈUnited States tawellman

Why! Why would you impose a limit? ... and why 25?

What a mess it has created for us. NO sense in going into detail how completely frustrated I am right now.

Please Fix it! Because of our site being built with a high reliance on Node Reference URL Widget, we do NOT have an option to migrate to Entity References.

πŸ‡ΊπŸ‡ΈUnited States tawellman

Why would you limit it to 25? Pain in the....!!! Please change it!

πŸ‡ΊπŸ‡ΈUnited States tawellman

Is this why page titles go away if you use layout builder on entities create with ECK?

I created an entity and tried enabling Layout Builder on it. When I do so, the title in both the html head and in the main content turns to the name of the Entity.


Crew | My Websites Name

Then in the I get this for the block-page-title-block.

Crew

It should be the name of the crew in that location. e.g. Irrigation Crew

I turn off Layout Builder and it works as intended.

Production build 0.71.5 2024