Step 1: create a datatime field in any content type
step 2: Render the datatime field in twig file.
step 3: Check the time tag <time datetime="2024-09-05T04:09:23Z">05/09/2024 12:09</time>
Both datatime and displayed time is different
Solution: In DateTimeFormatterBase.php field formatter, we need update the below code to fix this issue.
Current one in Core:
protected function buildDateWithIsoAttribute(DrupalDateTime $date) {
// Create the ISO date in Universal Time.
$iso_date = $date->format("Y-m-d\TH:i:s") . 'Z';
$this->setTimeZone($date);
$build = [
'#theme' => 'time',
'#text' => $this->formatDate($date),
'#attributes' => [
'datetime' => $iso_date,
],
'#cache' => [
'contexts' => [
'timezone',
],
],
];
return $build;
}
Solution: We need to move above $this->setTimeZone($date); to iso_date field conversion.
protected function buildDateWithIsoAttribute(DrupalDateTime $date) {
// Create the ISO date in Universal Time.
$this->setTimeZone($date);
$iso_date = $date->format("Y-m-d\TH:i:s") . 'Z';
$build = [
'#theme' => 'time',
'#text' => $this->formatDate($date),
'#attributes' => [
'datetime' => $iso_date,
],
'#cache' => [
'contexts' => [
'timezone',
],
],
];
return $build;
}
kmani โ created an issue.
Currently, i am patching the plugin id as empty as below
diff --git a/layout_builder_styles.module b/layout_builder_styles.module
index 99d83f1..c39d150 100644
--- a/layout_builder_styles.module
+++ b/layout_builder_styles.module
@@ -19,9 +19,7 @@ function layout_builder_styles_form_alter(&$form, FormStateInterface $formState)
/** @var \Drupal\layout_builder\Form\ConfigureBlockFormBase $formObject */
$formObject = $formState->getFormObject();
- $blockPluginId = $formObject
- ->getCurrentComponent()
- ->getPluginId();
+ $blockPluginId = "";
$bundle = FALSE;
// If this is a reusable block, retrieve the block bundle.
Hi abhinesh.
Thank you, and after updating the core, its working fine now
Thanks @abhinesh,
Yes, there was a dependency module paragraphs_ee and updated to latest. now working fine.
Hi abhinesh,
Thanks for the new version. but this module is included in https://www.drupal.org/project/ezcontent/releases/2.2.9 โ . can you please update the ezcontent also
kmani โ created an issue.
Any update on the above issue? after upgrading drupal 9.5 to Drupal 10.2.2
When viewing "/admin/content/files" it has a hard error and the page is unusable.
The website encountered an unexpected error. Try again later.
InvalidArgumentException: A path was passed when a fully qualified domain was expected. in Drupal\Component\Utility\UrlHelper::externalIsLocal() (line 305 of core/lib/Drupal/Component/Utility/UrlHelper.php).
Drupal\Core\File\FileUrlGenerator->generate('cloudinary://xxxx/images/2023/09/26/test_1695696987.jpeg') (Line: 99)
Drupal\file\Plugin\Field\FieldFormatter\BaseFieldFileFormatterBase->viewElements(Object, 'en') (Line: 89)
Drupal\Core\Field\FormatterBase->view(Object, 'en') (Line: 268)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array) (Line: 269)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple(Array) (Line: 226)
Drupal\Core\Entity\Entity\EntityViewDisplay->build(Object) (Line: 460)
Drupal\Core\Entity\EntityViewBuilder->viewField(Object, Array) (Line: 243)
Thanks, Eugen Zerr. After applying the patch, its working fine.
The same issue is happening to me also. after upgrading D9 to D10. some of the field group fileset are not visible in manage form display
kmani โ created an issue.
Thanks @abhinesh
Now its working fine.
kmani โ changed the visibility of the branch 3412668-srijanoneezcontent-2.2.7-requires to active.
kmani โ changed the visibility of the branch 3412668-srijanoneezcontent-2.2.7-requires to hidden.
kmani โ changed the visibility of the branch 3412668-srijanoneezcontent-2.2.7-requires to hidden.
Any update on this issue? we also facing same issue.e
kmani โ created an issue.
kmani โ made their first commit to this issueโs fork.
Use messenger interface to display messages while redirecting
use Drupal\Core\Messenger\MessengerInterface;
$this->messenger->addMessage('This is a warning message (orange)', TRUE);
This is because of FormattableMarkup and the image source has to convert markup.
Me too having same issue.
#15 works for me