mmmhh ok, maybe you could help me, I have updated the code to that:
{{ node.field_image|view|add_class("logo") }}
But the class is not showing, and in the image.html.twig i have the standard code:
<img{{ attributes }} />
I wanted to retrieve the uri, like that I could create my self the
I don't know if you could help
in Drupal 11, I'm using in the node.html.twig this code:
{{ dump(node.field_image|file_uri) }}
And I have two content rendered, one with a default image value setup in the content type, and the result is null and if I upload manually an image I got the uri, do you know if I need to do something?
Thanks
Alcindo
Ok I have found the way, but is not so obvious, maybe it can be a nice improve for Twig field value to create some helpers:
Images:
{{ file_url(elements.content['#block_content'].field_image.entity.field_media_image.entity.uri.value) }}
Videos:
{{ file_url(elements.content['#block_content'].field_video.entity.field_media_video_file.entity.uri.value) }}
could you please release a new version to be able to install it via composer
sir_squall → created an issue.
The documentation was not so good, if you had the same just go:
1. Create a new product variation and tick "provide a license"
2. Create a new product and select the variation that you just created
sir_squall → created an issue.
I found another thread with a Similar issue:
https://www.drupal.org/project/domain/issues/3295160 →
I don't know how to do the MRs..
I just tried the patch in #21 and it's working well
I just check the logs and the error is still there:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "elasticsearch_search_api.sync". in Drupal\Component\DependencyInjection\Container->get() (line 159 of ../web/core/lib/Drupal/Component/DependencyInjection/Container.php).
stracktrace:
#0 ../web/core/lib/Drupal.php(197): Drupal\Component\DependencyInjection\Container->get('elasticsearch_s...')
#1 ../web/modules/contrib/elasticsearch_search_api/elasticsearch_search_api.module(124): Drupal::service('elasticsearch_s...')
#2 ../web/core/lib/Drupal/Core/Cron.php(335): elasticsearch_search_api_cron()
#3 ../web/core/lib/Drupal/Core/Extension/ModuleHandler.php(395): Drupal\Core\Cron->Drupal\Core\{closure}(Object(Closure), 'elasticsearch_s...')
#4 ../web/core/lib/Drupal/Core/Cron.php(318): Drupal\Core\Extension\ModuleHandler->invokeAllWith('cron', Object(Closure))
#5 ../web/core/lib/Drupal/Core/Cron.php(159): Drupal\Core\Cron->invokeCronHandlers()
#6 ../web/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
#7 ../web/core/modules/system/src/CronController.php(38): Drupal\Core\ProxyClass\Cron->run()
#8 [internal function]: Drupal\system\CronController->run()
#9 ../web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#10 ../web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 ../web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#12 ../web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#13 /home/clients/0b0410226929a2217c55e05b2a446931/sites/d9.allnews.ch/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 /home/clients/0b0410226929a2217c55e05b2a446931/sites/d9.allnews.ch/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#15 ../web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 ../web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 ../web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 ../web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 ../web/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 ../web/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 ../web/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 ../web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 ../web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 ../web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 ../web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 ../web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 ../web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#28 {main}
Ok I used the api key (deprecated) and it's working well
Ok I had some progress here, I finnally make this working, the compser didn't wanted to the end because he didn''t had the permission to write on the default folder, so now the module is installed, but I have another error, I'm unable to login:
I did the Oauth authentificaiton, and in mailchimp in integration I got the new ligne ast he app is integretated correctly, but I still have the message that the oauth is not setup:
Unable to connect to Mailchimp API. Visit OAuth Settings page to authenticate or uncheck "Use OAuth Authentication" and add an api_key below (deprecated).
I have removed them and reinstall them, and still same error:
composer require drupal/mailchimp
./composer.json has been updated
Running composer update drupal/mailchimp
Loading composer repositories with package information
Updating dependencies
Lock file operations: 2 installs, 0 updates, 0 removals
- Locking drupal/mailchimp (2.2.4)
- Locking thinkshout/mailchimp-api-php (v3.0.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
- Downloading drupal/mailchimp (2.2.4)
- Installing thinkshout/mailchimp-api-php (v3.0.1): Extracting archive
- Installing drupal/mailchimp (2.2.4): Extracting archive
Generating autoload files
93 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
phpstan/extension-installer: Extensions installed
Scaffolding files for drupal/core:
this is my composer.json:
{
"name": "drupal/recommended-project",
"description": "Project template for Drupal 9 projects with a relocated document root",
"type": "project",
"license": "GPL-2.0-or-later",
"homepage": "https://www.drupal.org/project/drupal",
"support": {
"docs": "https://www.drupal.org/docs/user_guide/en/index.html",
"chat": "https://www.drupal.org/node/314178"
},
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "package",
"package": {
"name": "northernco/ckeditor5-anchor-drupal",
"version": "0.2.0.",
"type": "drupal-library",
"dist": {
"url": "https://registry.npmjs.org/@northernco/ckeditor5-anchor-drupal/-/ckeditor5-anchor-drupal-0.2.0.tgz",
"type": "tar"
}
}
}
],
"require": {
"composer/installers": "^1.9",
"drupal/anchor_link": "^3.0@alpha",
"drupal/antibot": "^2.0",
"drupal/backup_migrate": "^5.0",
"drupal/better_social_sharing_buttons": "^4.0",
"drupal/ckeditor": "^1.0",
"drupal/ckeditor5_findandreplace": "^1.1",
"drupal/ckeditor5_plugin_pack": "^1.2",
"drupal/ckeditor_find": "^2.0@beta",
"drupal/ckeditor_font": "^2.0@beta",
"drupal/content_entity_clone": "^1.0",
"drupal/core-composer-scaffold": "^10",
"drupal/core-project-message": "^10",
"drupal/core-recommended": "^10",
"drupal/datalayer": "^2.0@RC",
"drupal/editor_advanced_link": "^2.2",
"drupal/elasticsearch_connector": "^7.0@alpha",
"drupal/elasticsearch_search_api": "^2.1",
"drupal/entity": "^1.4",
"drupal/entity_clone": "^2.0@beta",
"drupal/entityqueue": "^1.6",
"drupal/facets": "^3.0@beta",
"drupal/facets_date_range": "^1.0@beta",
"drupal/fakeobjects": "^1.2",
"drupal/flexible_permissions": "^1.0",
"drupal/image_widget_crop": "^2.4",
"drupal/imce": "^3.0",
"drupal/linkit": "^6.1",
"drupal/ludwig": "^2.0",
"drupal/mailchimp": "^2.2",
"drupal/metatag": "^2.0",
"drupal/migrate_plus": "^6.0",
"drupal/migrate_tools": "^6.0",
"drupal/migrate_upgrade": "^4",
"drupal/paragraphs": "^1.15",
"drupal/pathauto": "^1.11",
"drupal/redirect": "^1.9",
"drupal/scheduler": "^2.0",
"drupal/search_api": "^1.29",
"drupal/search_api_page": "^1.0",
"drupal/search_api_sorts": "^1.1",
"drupal/simple_sitemap": "^4.1",
"drupal/twigsuggest": "^1.0@RC",
"drupal/upgrade_status": "^4.0",
"drupal/views_data_export": "^1.3",
"drupal/views_migration": "^1.2",
"drupal/webform": "^6.2",
"northernco/ckeditor5-anchor-drupal": "^0.2.0",
"thinkshout/mailchimp-api-php": "v3.0.1"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"composer/installers": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true,
"php-http/discovery": true
},
"sort-packages": true
},
"extra": {
"drupal-scaffold": {
"locations": {
"web-root": "web/"
}
},
"installer-paths": {
"web/core": [
"type:drupal-core"
],
"web/libraries/{$name}": [
"type:drupal-library"
],
"web/modules/contrib/{$name}": [
"type:drupal-module"
],
"web/profiles/contrib/{$name}": [
"type:drupal-profile"
],
"web/themes/contrib/{$name}": [
"type:drupal-theme"
],
"drush/Commands/contrib/{$name}": [
"type:drupal-drush"
],
"web/modules/custom/{$name}": [
"type:drupal-custom-module"
],
"web/profiles/custom/{$name}": [
"type:drupal-custom-profile"
],
"web/themes/custom/{$name}": [
"type:drupal-custom-theme"
]
},
"drupal-core-project-message": {
"include-keys": [
"homepage",
"support"
],
"post-create-project-cmd-message": [
"<bg=blue;fg=white> </>",
"<bg=blue;fg=white> Congratulations, you’ve installed the Drupal codebase </>",
"<bg=blue;fg=white> from the drupal/recommended-project template! </>",
"<bg=blue;fg=white> </>",
"",
"<bg=yellow;fg=black>Next steps</>:",
" * Install the site: https://www.drupal.org/docs/installing-drupal",
" * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
" * Get support: https://www.drupal.org/support",
" * Get involved with the Drupal community:",
" https://www.drupal.org/getting-involved",
" * Remove the plugin that prints this message:",
" composer remove drupal/core-project-message"
]
}
},
"require-dev": {
"drupal/core-dev": "^10"
}
}
Yes I have this modul installed:
composer require drupal/mailchimp:^2.2
./composer.json has been updated
Running composer update drupal/mailchimp
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
93 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
phpstan/extension-installer: Extensions installed
Scaffolding files for drupal/core:
And in the vendor directory:
ls -l vendor/thinkshout/mailchimp-api-php/
total 24
-rw-r--r-- 1 uid81104 gid81104 612 déc 8 2023 composer.json
-rw-r--r-- 1 uid81104 gid81104 3150 déc 8 2023 CONTRIBUTING.md
-rw-r--r-- 1 uid81104 gid81104 268 déc 8 2023 phpunit.xml
-rw-r--r-- 1 uid81104 gid81104 3966 déc 8 2023 README.md
drwxr-sr-x 3 uid81104 gid81104 4096 déc 8 2023 src
drwxr-sr-x 3 uid81104 gid81104 4096 déc 8 2023 tests
The module is there, but when I go to the "admin/config/services/mailchimp", I have this error:
The website encountered an unexpected error. Try again later.
Error: Class "\Mailchimp\Mailchimp" not found in Drupal\mailchimp\ClientFactory->createInstance() (line 161 of modules/contrib/mailchimp/src/ClientFactory.php).
super strange
Any idea how to solve that?
sir_squall → created an issue.
thanks Matt +1 (to follow the thread)
How I can disable this automatically behaviour? I don’t want to have the CDATA, an old told who is reading the feed doesn’t work with that…
I still got this error, when we are using the :
$node = \Drupal::routeMatch()->getParameter('node');
in this hook:
_preprocess_html(&$variables) {
we have this preg_quote error
sir_squall → created an issue.
sir_squall → created an issue.
amazing thanks
Hi,
You have to do the standard migration process, once you have your new website with the good image styles, the content migrated and the image migrated, then you can run this little script, if you have renamed the images style, you can also adapt the code, as I did:
// adapt old naming to new style naming
switch ($style_name) {
case 'image_liste' : //OLD ONE
$style_name = 'image_list'; // NEW ONE
break;
case 'partenaire' : //OLD ONE
$style_name = 'partenaires'; //NEW ONE
break;
case 'fond_liste' : //OLD ONE
$style_name = 'fond_list'; //NEWONE
break;
}
Then you run the command and the crops will be imported successfully, you don't have to take care of the x y, the calculation is the good one.
Thanks
I run the same command but in production, and everything worked well
sir_squall → created an issue.
The issue is still there, but no one is able to help us on that, unfortunately.
You are right, I have just updated it
sir_squall → created an issue.
De nada! Happy that I could help you on that! It took me a bit of time to develop that!
Have a nice day, next time I go to BCN you can offer me a beer ;)
sir_squall → created an issue.
I still have the error, but elasticsearch is working fine, i have this error only when the cron run don't know why
Hi,
i just tested the patch for 10.2.0 and 10.2.1 and it's working weel.
Thanks
did someone have a patch working for 10.2 at least?
I just tested it again on drupal 10.1.8-dev and it's not working anymore, do you know when this will be included in core?
Hi,
Yes it's this one the image_widget_crop.
Thanks
Thank you very much the path #50 work well!
Hi,
i got the same error, but I have php-curl enabled:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "elasticsearch_search_api.sync". in Drupal\Component\DependencyInjection\Container->get() (line 157 of /home/clients/xxx/sites/xxx/web/core/lib/Drupal/Component/DependencyInjection/Container.php).
Hello,
Yes, you have perfectly summarized it. This module allows us to create a page, and then in the display mode of the content type, we have the option to include a "Search result excerpt."
However, this approach may not be ideal. Perhaps we could have a more versatile solution, like a formatter that we can apply to any field, such as title, body, and so on. What are your thoughts on this?
Thank you.
I switched to Content Entity Clone, this module is working in a better way, as it redirect the user to the content pre-filled with the data, and like that we don't have any issue
@solideogloria Thanks!
I have migrated to D10 where this issue is not there anymore, but I appreciate that you have answered ;)
Or maybe drupal 10?
Hi,
Ok for those who are also interrested, i have created a new module with a drush command, and here is the code that will do the migration :
<?php
namespace Drupal\drush_migratecrops\Command;
use Drush\Commands\DrushCommands;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\DatabaseException;
use Drupal\Core\Database\Connection;
use Drupal\crop\Entity\Crop;
/**
* Drush command file.
*/
class MigrateCropsCommands extends DrushCommands {
/**
* Drush command that migrates the focal points
*
* @command migrate:crops
* @aliases mcr
* @usage migrate:crops
*/
public function migrate_crops() {
$file_storage = \Drupal::service('entity_type.manager')->getStorage('file');
$crop_storage = \Drupal::service('entity_type.manager')->getStorage('crop');
// delete previous crops
$crops = $crop_storage->loadByProperties(['entity_type' => 'file']);
foreach ($crops as $crop) {
$crop->delete();
}
$database = Database::getConnection('default', 'migrate');
$count = $query = $database
->select('file_managed', 'fm')
->fields('fm', ['fid', 'uri','uuid'])
->fields('mc', ['y','x','height', 'width','style_name']);
$query->leftJoin('manualcrop', 'mc', 'fm.fid = mc.fid');
$sandbox['last_fid'] = 0;
$sandbox['num_processed'] = 0;
$sandbox['num_skipped'] = 0;
$sandbox['total_items'] = $count->countQuery()->execute()->fetchField();
$results= $query->execute()->fetchAll();
foreach($results as $result) {
$style_name = $result->style_name;
if(!$style_name) {
continue;
}
// adapt old naming to new style naming
switch ($style_name) {
case 'image_liste' :
$style_name = 'image_list';
break;
case 'partenaire' :
$style_name = 'partenaires';
break;
case 'fond_liste' :
$style_name = 'fond_list';
break;
}
// get FID on d10
$files =$file_storage->loadByProperties(['uri' => $result->uri]);
$file = reset($files) ?: NULL;
if (!is_null($file)) {
$sandbox['last_fid'] = $file->id();
$crop_data = [
'type' => $style_name,
'entity_id' => $file->id(),
'entity_type' => $file->getEntityTypeId(),
'uri' => $result->uri,
'x' => (int) round(($result->x ) + ($result->width / 2)),
'y' => (int) round(($result->y )+ ($result->height/ 2)),
'width' => $result->width,
'height' => $result->height
];
try {
$crop = $crop_storage
->create($crop_data)
->save();
} catch (Exception $e) {
$sandbox['num_skipped']++;
$this->output()->writeln( 'unable to save: ' . $crop_data);
}
$sandbox['num_processed']++;
} else {
$sandbox['num_skipped']++;
}
}
$this->output()->writeln( 'last_fid: ' . $sandbox['last_fid'] );
$this->output()->writeln( 'num_processed: ' . $sandbox['num_processed'] );
$this->output()->writeln( 'num_skipped: ' . $sandbox['num_skipped'] );
$this->output()->writeln( 'total_items: ' . $sandbox['total_items'] );
}
}
Hi,
I understand, on my side I don't think I will be able to do this update and submit a MR.
Thanks
sir_squall → created an issue.
Yes, same on my side, my client don't understand why they cannot put external link on image and opening in an external window...
I hope this issue will be solve soon.
fully agree, this module is much easier, more faster, and go directly to the edit page (create), just perfect
sir_squall → created an issue.
Does anyone know if this will be prioritized? This module is really nice, and the facet is really cool to filter dates.
Does anyone know if this will be prioritized? It's having a significant impact on the end user. Not being able to open external links in new windows is quite annoying.
I just tried to install this module, and when I updated drupal to 10.1.3 I didn't get the error, thanks
Same issue there, I'm using IMCE and when we put an image in the body, and we try to add a link to it and put this in "open in a new window" option, it's not working
I just did the drupal uprade, and I got this error back again, do you know when this will be apply to the drupal 10 core?
I just figured out that I forgot the "ajax_load_node.links.menu.yml" :
ajax_load_node.settings:
title: 'Ajax load Settings'
route_name: ajax_load_node.settings
description: 'Ajax load settings'
parent: system.admin_config_system
weight: 99
sir_squall → created an issue.
I just tried to install it but I got some composer core incompatibility:
sir_squall → created an issue.
thanks a lot
sir_squall → created an issue.
Hi,
Finally I have move from div to p, it work well. Quick question, how can we disable the "multiple style" behavior? The user need every time to click to remove the previous one, it's not really convenient like that.
Thanks
hi @nsciacca,
Thanks a lot for the patch!
I had the same issue but without paragraph, I have upgraded from D9 to D10, and then the clone was giving me this error:
Fatal error: Allowed memory size of 671088640 bytes exhausted (tried to allocate 20480 bytes) in .../core/lib/Drupal/Core/Field/FieldItemBase.php on line 109
I applied your patch, and now the clone is working well.
I think we should apply this patch in the module, to avoid this error in the future.
Thanks
I found the solution, just under the format->show content, you have a link call settings, when you clic on it you can also require the relationship there, and it's working well.
Hi Again,
I make found a solution, when you put the styles you have to first click our the fiel to have the ajax call to save the styles only after you can save the form.
So now I have the style correclty setup, but the stlye button in CKEditor is still disabled, I have put those styles:
div.texte|Texte
div.intertitre|Intertitre
div.exerge|Exerge
div.encadrer-titre|Encadrer Titre
div.encadrer-texte|Encadrer Texte
div.itw-question|ITW Question
div.itw-reponse|ITW Réponse
div.note-bas|Note Bas
But the button is not working, do I need to do something ?
Thanks
Ok because, I tried in Drupal 10.1.2 after having updated from 9.5 and when I save the styles in the ckeditor configuration, I got this error:
AssertionError: assert(NestedArray::keyExists($subform, $parts)) in assert() (line 892 of core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php).
I just tried to put that:
div.intertitre|intertitre
Thanks
I just updated from drupal 9.5 to 10.1.2 and I got this error:
AssertionError: assert(NestedArray::keyExists($subform, $parts)) in assert() (line 892 of core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php).
it's when I tried to save the styles, I added that inside:
div.intertitre|intertitre
and impossible to save.
sir_squall → created an issue.
Ok fine, I will upgrade to 10 so, how can I apply the fix?
I still go the error in the latest version of the module and in Drupal 9.5:
Fatal error: Allowed memory size of 671088640 bytes exhausted (tried to allocate 20480 bytes) in .../core/lib/Drupal/Core/Field/FieldItemBase.php on line 109
sir_squall → created an issue.
Do we have a patch working for drupal 9.5?
Hi,
What about Drupal 9, the bug is still there for the div?
Thanks
Do we have a patch who is working well for the last drupal 9 version?