It's a pretty common practice to sort favorite items based on the date the item was flagged. We want the most recent flagged item on top and the oldest flagged item at the bottom. This is not about the date of the item itself, when it was created or changed, it's about the flagging.
At the moment we can filter an item based on if it's flagged or not but we can't sort it based on the date it was flagged, this would be very much appreciated.
The date of flagging is in the database so I've achieved this with a hook_views_pre_render that queries the database and reorder results but it's not ideal.
wranvaud → created an issue.
#5 works for me while #6 and #10 have no effect.
It would be great to have also some instructions on how to use it.
You have to add a field to the user /admin/config/people/accounts/fields in order to have something to select.
Done! Thank your for your patience.
Until we have a condition to display only on some languages I'm going to keep the functionality as it is. I'll convert this to a feature request. Otherwise we wouldn't be able to hide the message in a language that does not have translations.
Merged! Thank you!
Duplicate of https://www.drupal.org/project/conditional_message/issues/3286638 📌 Automated Drupal 10 compatibility fixes Fixed
Duplicate of https://www.drupal.org/project/conditional_message/issues/3286638 📌 Automated Drupal 10 compatibility fixes Fixed
Merged! Thank you!
Apparently this changed to {{ content.node_read_time }}
Added a short explanation of what extending a template means and removed the comments from templates that pollutes the explanations.
wranvaud → created an issue.
wranvaud → created an issue.
I had this problem too and the error was likely a DNS issue. I turned on my VPN and it started working then even after turning the VPN off it was still working.
@lubwn you could use an update hook instead that let's you do bulk updates without timing out if you have many entities and you can also leave the code because it will only execute once on each environment.
function mymodule_update_9001(&$sandbox) {
// Initialize variables on the first run.
if (!isset($sandbox['total'])) {
$entity_list = \Drupal::entityQuery('node')
->condition('type', 'my_entity')
->execute();
$langcodes = \Drupal::languageManager()->getLanguages();
$sandbox['langcodes'] = array_keys($langcodes);
$sandbox['total'] = count($entity_list);
$sandbox['current'] = 0;
}
// Batch cycle.
$batch_nids = \Drupal::entityQuery('node')
->condition('type', 'my_entity')
->range($sandbox['current'], 15)
->execute();
foreach ($batch_nids as $nid) {
$my_entity = \Drupal::entityTypeManager()->getStorage('node')->load($nid);
// Loop through all languages.
foreach ($sandbox['langcodes'] as $langcode) {
if ($my_entity->hasTranslation($langcode)) {
$my_entity_translation = $my_entity->getTranslation($langcode);
// Avoid re-saving nodes that don't need to be updated.
if ($my_entity_translation->path->pathauto !== 1) {
$my_entity_translation->path->pathauto = 1;
$my_entity_translation->save();
}
}
}
$sandbox['current']++;
}
if ($sandbox['current'] >= $sandbox['total']) {
$sandbox['#finished'] = 1;
\Drupal::messenger()->addMessage('A total of ' . $sandbox['total'] . ' entities were updated.');
}
else {
$sandbox['#finished'] = ($sandbox['current'] / $sandbox['total']);
// Output a message to inform about the ongoing process.
\Drupal::messenger()->addMessage($sandbox['current'] . ' entities were updated out of ' . $sandbox['total']);
}
}
@Rade @dunot This is a different issue, the patch proposed at #3258535 does not fix the problem described here. The problem here also happens with fields that are not entity references.
The patch proposed for this issue is very similar to the patch #40 at #3050027.
https://www.drupal.org/project/entity_clone/issues/3050027#comment-14816729
🐛
Inline Blocks on Layout Builder Fail to Clone Correctly
Needs work
This is happening on taxonomy terms with an empty description. It looks like checking for the value before unserializing is a good solution though I believe null coalescing operator is better than type casting because casting an array to string would output "Array" rather than throwing an error.