2.0.3 update should containers

Created on 30 August 2024, 4 months ago
Updated 12 September 2024, 3 months ago

Problem/Motivation

ArgumentCountError: Too few arguments to function Drupal\twig_field_value\Twig\Extension\FieldValueExtension::__construct(), 4 passed in /web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 261 and exactly 5 expected in Drupal\twig_field_value\Twig\Extension\FieldValueExtension->__construct() (line 78 of modules/contrib/twig_field_value/src/Twig/Extension/FieldValueExtension.php).

I guess we need this in the .install file:

/**
 * Rebuild the container cache.
 */
function MYMODULE_update_NNNNNNN() {
  \Drupal::service('kernel')->rebuildContainer();
}

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

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

Merge Requests

Comments & Activities

  • Issue created by @Anybody
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • Assigned to Grevil
  • Status changed to Needs review 4 months ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @grevil: Please test and review.

  • Issue was unassigned.
  • Status changed to RTBC 4 months ago
  • πŸ‡©πŸ‡ͺGermany Grevil

    Usually a simple "drush cr" after the update would be enough here, but we can simply clear the cache as well! LGTM.

  • Status changed to Fixed 4 months ago
  • πŸ‡©πŸ‡ͺGermany Grevil
  • πŸ‡­πŸ‡ΊHungary djg_tram

    Same error with updating to 2.0.4, simple cache clear doesn't help.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @djg_tram did you run updb and see the update message also?

  • πŸ‡­πŸ‡ΊHungary djg_tram

    I had to:

    1. manually remove the Renderer argument from the constructor.
    2. Clear cache so that the site will return from WSOD.
    3. Re-insert the argument.
    4. Run UPDB manually.
    5. Then it works.

    Not fun. The upgrade process should be tested a bit more, I'm afraid. :-) This was on a production site that isn't used yet intensively. It would be a major PITA on a real production site.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @djg_tram it is tested, so I'm wondering how that happens. Typically only (4.) should be required.

    I guess you're doing updates manually (+ update.php)?, not using composer and drush?

    Just to better understand the circumstances...

  • πŸ‡­πŸ‡ΊHungary djg_tram

    It depends on the particular site and situation. If I'm already inside a site with smaller traffic volume and requirements (not one that postulates fully separated test and production environments, just the smaller garden variety ones), logged in and just see that a couple of modules need to be upgraded, it's usually much simpler to let it happen there with the UI and then run the update as well. I also use the new Navigation module with my own additions that make both db update and cache clear readily available. In these cases, I only fire up the console access with Drush if necessary (core upgrade needed or WSOD).

    With more complex schemes I might go the Composer and Drush route immediately. I don't particulary like the Composer approach for modules, so I tend to avoid it with my own modules but that's more like a question of preferences. At any rate, even if many modules do recommend Composer, I still think that as long as Drupal actually has the old way, that should also work.

    Especially as, unfortunately, it's still not always easy to set up an environment that provides full Drush/Composer functionality, I just happened on a site where drush cr works but drush updb does not because proc_open is disabled and while they offer up a few items of php.ini to customize, this isn't among those. And equally unfortunately, just telling the client to move to a better provider is not always the most feasible solution. :-)

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Thanks for the details @djg_tram. Just one last question: After updating the module, were you able to access /update.php and run the update(s)?

  • πŸ‡­πŸ‡ΊHungary djg_tram

    No, there was a WSOD that blocked everything. I could only solve it by temporarily modifying the source code (as described above). As I do module development actively myself (both some contrib and many for in-house solutions), it was possible but not all admins are created equal. :-)

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @djg_tram I tried reproducing this in several projects and environments and can't reproduce or confirm it anywhere. I think your criticism is unjustified. We also have no other reports of that issue.

    So I'm finally closing this, of course I'm still sorry for the trouble you had.

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

  • πŸ‡ΊπŸ‡¦Ukraine Taran2L Lviv

    @anybody hi

    Unfortunately, this is not how this thing should be fixed, as update runs after cache rebuild (usually), so I can't get to that.

    Core always adds a BC layer when arguments change, this should be done here as well.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Thanks @taran2l,

    could you please implement the suggested change to let me know, how it should be done. This is open source, so thank you for your help and advice!

  • πŸ‡ΊπŸ‡¦Ukraine Taran2L Lviv
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Thanks @taran2l!

Production build 0.71.5 2024