CSS Async Loading

Created on 26 November 2024, 2 months ago

Problem/Motivation

Extract the async loading mechanism from the internal code base.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland znerol

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @znerol
  • Merge request !14Issue #3489962: Implement deferred loading β†’ (Merged) created by znerol
  • πŸ‡¨πŸ‡­Switzerland znerol
  • I have applied the patch and I have encountered an error when switching the attachment strategy in the form.

    The AJAX call fails with the following stacktrace:

    Auf der Website ist ein unerwarteter Fehler aufgetreten. Versuchen Sie es spΓ€ter noch einmal.
    
    Error: Typed property Drupal\tone\Plugin\ToneAttachmentStrategy\CssPublicFiles::$loadAsync must not be accessed before initialization in Drupal\tone\Plugin\ToneAttachmentStrategy\CssPublicFiles->buildConfigurationForm() (line 183 of modules/contrib/tone/src/Plugin/ToneAttachmentStrategy/CssPublicFiles.php).
    
    Drupal\tone\Form\ToneTypeForm->form() (Line: 107)
    Drupal\Core\Entity\EntityForm->buildForm()
    call_user_func_array() (Line: 536)
    Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 375)
    Drupal\Core\Form\FormBuilder->rebuildForm() (Line: 633)
    Drupal\Core\Form\FormBuilder->processForm() (Line: 326)
    Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult() (Line: 39)
    Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 54)
    ...
    

    I have changed the declaration of $loadAync to protected bool $loadAsync = FALSE;, and it seems to fix the issue.

  • πŸ‡¨πŸ‡­Switzerland znerol

    Thanks! Good find, that's probably an issue when operating on a preexisting entity.

  • πŸ‡¨πŸ‡­Switzerland znerol
  • Pipeline finished with Skipped
    2 months ago
    #360575
  • πŸ‡¨πŸ‡­Switzerland znerol
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024