The merge request patch is working for me with easy_breadcrumb 2.0.8. I appreciate all the background information, too!
The issue is still occurring with the new/experimental widget. So far, I've only noticed it with paragraphs that have an image upload field.
To replicate:
- Build a stock Drupal site with the Standard installation profile. Also install paragraphs.
- Create a new paragraph type.
- Add an image upload field to your new paragraph type. Use all the default values when setting up your image field.
- Create a custom block type.
- Add a paragraph field to your new custom block type. Make sure to allow adding the new paragraph type you just created.
- Create a content block using the new custom block type that you just created. Add an image to the paragraph in your block. Fill out any other required fields. Save.
- Edit the content block that you just created. Collapse all of the paragraphs. Note that your paragraph has unsaved changes, which is impossible because you have not made any changes since saving.
The isChanged() method in the Paragraphs entity class compares the latest revision of each field to the version that is currently present in the form when the accordion is collapsed. The latest revision of the ImageItem field contains height and width data that does not exist in the current version. The values in the ImageItem revision will look something like this:
values => {
target_id => 1,
alt => "test image",
title => "",
width => "2000",
height => "500",
}
The values in the current ImageItem will look like this even when there aren't any changes to it:
values => {
alt => "test image",
display => 1,
description => "",
upload_button => {Drupal\Core\StringTranslation\TranslatableMarkup}
remove_button => {Drupal\Core\StringTranslation\TranslatableMarkup}
upload => "",
title => "",
target_id => 1,
}
In FieldItemList::equals, this is filtered down to this for the ImageItem revision before determining whether or not to show the Unsaved Changes icon:
values => {
target_id => 1,
alt => "test image",
title => "",
width => "2000",
height => "500",
}
And this for the current ImageItem:
values => {
alt => "test image",
title => "",
target_id => 1,
}
Because there's no height or width set on the current ImageItem and it isn't possible to set these values by default, any paragraph with an image upload field will always show as having unsaved changes. I'm not really sure what should be done to fix this, because some people might have the image upload field set up to expose the width and height for users to change, in which case this difference becomes important. If you don't allow users to change the width and height in the field, however, these values should be ignored somehow.
Updated the patch to work with the 4.1.x-dev branch.
Did some debugging on this. I discovered that the route parameters in the conditional on line 409 in MenuBasedBreadcrumbBuilder.php were sorted slightly differently for some reason. If the array sorting is normalized before running the conditional, then it resolves to TRUE and the menu breadcrumb appears as expected on views pages using two or more contextual filters.
angelamnr β created an issue.