Problem/Motivation

\Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber::onEntityTypeUpdate() loads and re-saves every view every time an entity definition is updated, even when there are no changes needed.

Proposed resolution

Make it return early if no changes were detected.

Remaining tasks

Review.

User interface changes

Nope.

API changes

Nope.

Data model changes

Nope.

CommentFileSizeAuthor
#2 2851214.patch743 bytesamateescu

Comments

amateescu created an issue. See original summary.

amateescu’s picture

StatusFileSize
new743 bytes

This should do it.

amateescu’s picture

Status: Active » Needs review
Issue tags: +Quickfix

This is also a small performance improvement for our update path tests because not loading and saving all the views every time is faster than doing it :)

timmillwood’s picture

Status: Needs review » Reviewed & tested by the community

Looks like a simple solution.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed f8ec0d1 to 8.4.x and 6dfa2cb to 8.3.x. Thanks!

Makes sense and I'm not sure a test is simple and worth the effort.

  • alexpott committed f8ec0d1 on 8.4.x
    Issue #2851214 by amateescu: ViewsEntitySchemaSubscriber does a lot of...

  • alexpott committed 6dfa2cb on 8.3.x
    Issue #2851214 by amateescu: ViewsEntitySchemaSubscriber does a lot of...
alexpott’s picture

We should file a follow-up to improve the performance of the method - we should only save the views that have changed.

Status: Fixed » Closed (fixed)

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

amateescu’s picture