Problem/Motivation

Would be useful if the scheduled updates list showed the items being updated.
Unfortunately $entity->entity_ids is always empty.
So it looks ugly, like this.

Proposed resolution

Something like this.

Remaining tasks

Inject stuff
Determine if entity_ids should contain the right info and forego jumping through hoops

User interface changes

?

API changes

?

Data model changes

?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

larowlan created an issue. See original summary.

larowlan’s picture

Issue summary: View changes
StatusFileSize
new37.93 KB
bkosborne’s picture

I'm guessing this was probably left out from the initial implementation because it's a bit complex to retrieve the target entities. There can also be multiple entities that a scheduled update affects. So the UI for that wouldn't be great if you had any more than a couple.

But yeah, without the info of the "what" the scheduled update is affecting, this page is quite confusing.

realityloop’s picture

Status: Active » Reviewed & tested by the community

works as advertised... I do wonder if this should possibly be a view though?

chop’s picture

Works well. Using this patch in production.

shaktik’s picture

it's working fine.

mhavelant’s picture

It's working well, however, if you have lots of revisions then it looks pretty overwhelming and every link points to the latest revision.

tedbow’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/src/ScheduledUpdateListBuilder.php
@@ -81,7 +83,27 @@ public function buildRow(EntityInterface $entity) {
+    $target_fields = $runner->getReferencingFieldIds();
+    $target_field = reset($target_fields);
+    $revisions = \Drupal::entityQuery($target_type)->allRevisions()->condition($target_field . '.target_id', $entity->id())->execute();

$target_fields will be empty if \Drupal\scheduled_updates\Plugin\UpdateRunner\IndependentUpdateRunner is the update runner.

This is when $entity->entity_ids is not empty.

Basically IndependentUpdateRunner doesn't rely on an entity reference field on the target entity type. It uses the entity reference field on the Scheduled Update entity to allow targeting of multiple entities with 1 update.

So will cause an error in the current patch.

tedbow’s picture

Issue tags: +Needs tests

Also we should have test for each type of update, loading the update list page and confirming the title is shown.

ygstnd’s picture

StatusFileSize
new1.97 KB

I got the error like this:

No link template 'latest-version' found for the 'node' entity type in Drupal\Core\Entity\EntityBase->toUrl()

Here's a patch that works for me. It's based on the previously added one.

henry tran’s picture

StatusFileSize
new1.66 KB

I've rerolled to latest version

smustgrave made their first commit to this issue’s fork.

  • smustgrave committed 3c7d8f94 on 3.0.x
    feat: #2698143 Show the entities being updated in the list builder
    
smustgrave’s picture

Version: 8.x-1.x-dev » 3.0.x-dev
Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.