🇬🇧United Kingdom @alexpott

🇪🇺🌍
Account created on 27 June 2007, about 18 years ago
#

Merge Requests

More

Recent comments

🇬🇧United Kingdom alexpott 🇪🇺🌍

Added some review questions. I very concerned about the hash value and \Drupal\redirect\Entity\Redirect::preSave()

🇬🇧United Kingdom alexpott 🇪🇺🌍

This looks great - nice test @mglaman. I merged in 2.x and fixed up PHPCS.

🇬🇧United Kingdom alexpott 🇪🇺🌍

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

🇬🇧United Kingdom alexpott 🇪🇺🌍

This will be fixed and tested by 🐛 Use RedirectRepository for matching redirects Active - note we need a release of redirect so that we can depend on a version that has 🐛 Invalidate cached responses when new redirects are added Active fixed.

🇬🇧United Kingdom alexpott 🇪🇺🌍

alexpott changed the visibility of the branch 3541101-only-drafts-plugin to hidden.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Okay looking at Add content moderation support, for preserving "published" state revisions Fixed it seems there is a use-case but the implementation leaves a bit to be desired. Let's fix it.

🇬🇧United Kingdom alexpott 🇪🇺🌍

It also has a dependency on the content_moderation module as it does $revision_state = $revision->get('moderation_state')->getString(); but it does not check whether such a field exists or if content moderation is enabled.

What I think the plugin actually does is delete draft revisions older than the active revision - i.e. old revisions that have never been published.

I'm not sure this module should be supplying a plugin for that case -especially one that says After this time, draft revisions newer than the active revision can be deleted. The minimum age of revisions is always respected, regardless of other settings. Only draft revisions created after the active revision will be deleted. when it actually does something completely different.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Need a bit more information about how the queue is being processed when you get this error.

🇬🇧United Kingdom alexpott 🇪🇺🌍
  1. +++ b/src/Commands/AdvancedQueueCommands.php
    @@ -95,6 +95,57 @@ class AdvancedQueueCommands extends DrushCommands {
    +   * @option timeout The maximum execution time for each queue. Defaults to 90 seconds.
    

    Do we need to be smarter here. If we have a max execution time setting in PHP it feels like we need to stop the script before it overshoots it. I think this is more problematic than the single queue processor...

  2. +++ b/src/Commands/AdvancedQueueCommands.php
    @@ -95,6 +95,57 @@ class AdvancedQueueCommands extends DrushCommands {
    +      if (extension_loaded('pcntl')) {
    +        pcntl_async_signals(TRUE);
    +
    +        pcntl_signal(SIGTERM, function () {
    +          $this->processor->stop();
    +        });
    +
    +        pcntl_signal(SIGINT, function () {
    +          $this->processor->stop();
    +        });
    +      }
    

    This doesn't need to be done in the loop.

Can we convert this to an MR? Thanks!

🇬🇧United Kingdom alexpott 🇪🇺🌍

Plenty of merge conflicts now.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Let's get this fixed.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Actually we have this functionality in 8.x-1.x and we're trying to use transactions to do it properly but we've not done it right. Going to use this issue to fix it so I can credit @nvahalik for their original work here.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Afaics this is still an issue in 8.x-1.x so moving there.

🇬🇧United Kingdom alexpott 🇪🇺🌍

In 8.x-1.x the drush command needs a queue ID so this is outdated as 7.x-1.x is no longer supported.

🇬🇧United Kingdom alexpott 🇪🇺🌍

In 8.x-1.x you enqueue a job object and this is updated with the job ID. As 7.x-1.x is unsupported this can be closed as outdated.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Afaics we do this correctly now in 8.x-1.x - see

    if (extension_loaded('pcntl')) {
      pcntl_async_signals(TRUE);

      pcntl_signal(SIGTERM, function () {
        $this->processor->stop();
      });

      pcntl_signal(SIGINT, function () {
        $this->processor->stop();
      });
    }

Closing as outdated as 7.x-1.x is no longer supported.

🇬🇧United Kingdom alexpott 🇪🇺🌍

This sounds like a good idea and I don't think there is a corollary in the 8.x-1.x issue queue so going to move it there. Obvsiously the existing work will need to be completely redone.

🇬🇧United Kingdom alexpott 🇪🇺🌍

This view no longer exists - we're using a config list builder for the equivalent page in 8.x-1.x

🇬🇧United Kingdom alexpott 🇪🇺🌍

7.x-1.x is unsupported and a similar issue exists for 8.x-1.x with work on it so going to close in favour of that one. See Create a way to empty a queue Active

🇬🇧United Kingdom alexpott 🇪🇺🌍

This view no longer exists in 8.x-1.x - the list of queues is done using a config entity list builder and 7.x is no longer supported.

🇬🇧United Kingdom alexpott 🇪🇺🌍

This text no longer exists in the 8.x-1.x version and the 7.x version is no longer supported.

🇬🇧United Kingdom alexpott 🇪🇺🌍

This code is no longer present in the 8.x-1.x version therefore and that version is no longer supported so closing this issue.

🇬🇧United Kingdom alexpott 🇪🇺🌍

As this feature request has not received any support or work for nearly 8 years I'm closing this. one.

🇬🇧United Kingdom alexpott 🇪🇺🌍

alexpott created an issue.

🇬🇧United Kingdom alexpott 🇪🇺🌍

@ankitv18 sorry I was already working on this and raised the minimum already - which imo is fine as 10.3 is not supported. I force pushed because your changes are now unnecessary and other changes are.

🇬🇧United Kingdom alexpott 🇪🇺🌍

alexpott created an issue.

🇬🇧United Kingdom alexpott 🇪🇺🌍

alexpott created an issue.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Given 7.x is no longer supported closing this issue. If someone wants to implement this on the currently supported module for Drupal 10 and 11 please open a new issue.

🇬🇧United Kingdom alexpott 🇪🇺🌍

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

🇬🇧United Kingdom alexpott 🇪🇺🌍

This needs more changes. We're in a loop for redirect loop detection but that's part of the repository so it shouldn't be doing that here. Plus we should leverage 🐛 Invalidate cached responses when new redirects are added Active to get the cacheable metadata correct.

🇬🇧United Kingdom alexpott 🇪🇺🌍

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

🇬🇧United Kingdom alexpott 🇪🇺🌍

The code in question was mostly modified to work this way in #2845884: Redirect setRedirect only saves internal paths - I think the use of isValid() to detect externalness is wrong. We should be using UrlHelper::isExternal(). I think there is a further follow-up to consider whether or not we should allow invalid external URLs to be set. In my opinion this should cause an error.

🇬🇧United Kingdom alexpott 🇪🇺🌍

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

🇬🇧United Kingdom alexpott 🇪🇺🌍

I've removed tests/phpunit.xml because it's not really possible for a provide a working phpunit.xml for D10 and D11 so it's pointless.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Re-titling issue to make it clear what is happening. I think dropping D9 support is okay because it is now unsupported.

🇬🇧United Kingdom alexpott 🇪🇺🌍

These changes would mean we have to drop the Drupal 9 support. I think this seems fine but maybe we want a new major version to do that.

🇬🇧United Kingdom alexpott 🇪🇺🌍

So one thing that's occurred to me and feels like a bit of a problem... this puts the onus of translatability of config actions on the recipe author and not the config action author and that feels kinda wrong. Because the same config action can be used by many different recipe authors.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Addressed #11.

🇬🇧United Kingdom alexpott 🇪🇺🌍

I love to completely remove this and replace with indexes on json now we require json storage...

🇬🇧United Kingdom alexpott 🇪🇺🌍

I've addressed @berdir's feedback - thanks for the review!

🇬🇧United Kingdom alexpott 🇪🇺🌍

Totally agree that running multiple PHPStan jobs is a recipe for confusion and pain.

Will do the rest as asked as it all makes sense to me! Thanks for thinking about this @berdir.

🇬🇧United Kingdom alexpott 🇪🇺🌍

@quietone thanks for the bisect. Went ahead with 🐛 Fix EntityQueryTest on SQLite and Postgres Active so we can close this one again.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Committing this so Postgres and SQLite are green again.

Committed and pushed 1b1133d1ff8 to 11.x and 71171df537a to 11.2.x and 23b79dfebd6 to 10.6.x and 1a0d6efea9d to 10.5.x. Thanks!

🇬🇧United Kingdom alexpott 🇪🇺🌍

We already have sorts on other queries in these tests and we don't guarantee the result of an unsorted query so for me these changes are fine. Also both of these queries were added by 🐛 Entity queries querying the latest revision very slow with lots of revisions Needs work and would have failed on Postgres without the change to EntityQuery in that issue.

🇬🇧United Kingdom alexpott 🇪🇺🌍

I've fixed the MR to redo the check if the change the source path and I've added test coverage to ensure that you can save a redirect that overrides a path still.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Added unit test and paired the patch back to the minimum necessary change.

I think this is a nice change that improves redirect validation and the ability to create redirects via an API.

🇬🇧United Kingdom alexpott 🇪🇺🌍

    // The node should retain the translations from the last default revision.
    // @see \Drupal\Core\Entity\ContentEntityStorageBase::createRevision.
    $this->assertTrue($node->hasTranslation('it'));

This feels like a massive change of expectations. If you revert to a revision before a translation a translation has been created I would not expect translations that were added afterwards to exist. I don't know but this choice seems deliberate.

Are we sure this change is correct?

🇬🇧United Kingdom alexpott 🇪🇺🌍

Even though the minimum version of Redirect is now Drupal 10 I've made the change to isEmpty() as per @krystalcode's comment.

🇬🇧United Kingdom alexpott 🇪🇺🌍

alexpott changed the visibility of the branch 3451531-phpstan-issue-report to hidden.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Committed da29801 and pushed to 11.2.x. Thanks!
Committed and pushed 265731eb2b7 to 10.6.x and 392338a899e to 10.5.x. Thanks!

I did a cherry pick back to 10.x and fixed up the tiny conflict on commit.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Committed 6078270 and pushed to 11.x. Thanks!

We need an MR for 11.2.x - things have moved around a lot because hook stuff. ONce we have this in 11.2.x then yes we should get this in 10.6.x and 10.5.x too...

🇬🇧United Kingdom alexpott 🇪🇺🌍

Committed edbbe5c and pushed to 11.x. Thanks!
Committed c70b768 and pushed to 11.2.x. Thanks!

More information to help people makes sense.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Committed fc1872a and pushed to 11.x. Thanks!

Backported to 11.2.x,10.6.x,10.5.x without the PHPCS rule
Committed 71976f3 and pushed to 11.2.x. Thanks!
Committed e35092a and pushed to 10.6.x. Thanks!
Committed 2d8538d and pushed to 10.5.x. Thanks!

🇬🇧United Kingdom alexpott 🇪🇺🌍

Given PHP has deprecated this it is no longer an issue for our coding standards committee (they have no choice here anymore) so merging this to 11.x to stop any new cases getting back in to core.

We need to open an issue to backport 📌 Inconsistent switch case syntax Downport to 10.6.x / 10.5.x so that branch can get PHP 8.5 testing and compatibility.

Committed ef77219 and pushed to 11.x. Thanks!

🇬🇧United Kingdom alexpott 🇪🇺🌍

Looks great now. I dunno about formalising things - like this is the first XML fill we've added this to I think.

🇬🇧United Kingdom alexpott 🇪🇺🌍

See no harm in back porting this one all the way to 10.5.x...

Committed 96e0b25 and pushed to 11.x. Thanks!
Committed f1bcab7 and pushed to 11.2.x. Thanks!
Committed 7497a37 and pushed to 10.6.x. Thanks!
Committed d6d33f2 and pushed to 10.5.x. Thanks!

🇬🇧United Kingdom alexpott 🇪🇺🌍

For me it bleongs belong the xml - it's got nought to do with the running of the file... and having it there would be inline with having it after the namespace like we do with PHP.

The aim is to have it easy to spot and easy to ignore.

🇬🇧United Kingdom alexpott 🇪🇺🌍

Can we move it to the top of the file... because this can become a list of all the non-words in the file. It's easier to maintain I think.

🇬🇧United Kingdom alexpott 🇪🇺🌍

More info on the .api.php changes... there are 3 hooks where this MR is remeving docs:

  • hook_redirect_load: the signature is wrong and this better documented by hook_ENTITY_TYPE_load() in entity.api.php
  • hook_redirect_load_by_source_alter: does not exist anymore
  • hook_redirect_prepare: does not exist anymore and is replaced by hook_ENTITY_TYPE_prepare_form (which is documented in entity.api.php)
🇬🇧United Kingdom alexpott 🇪🇺🌍

The redirect.api.php stuff is changed because we've got PHPCS issues in the file

FILE: /Volumes/dev/sites/drupal8alt.dev/modules/redirect/redirect.api.php
-------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
-------------------------------------------------------------------------
 101 | ERROR | Missing parameter type
 103 | ERROR | Missing parameter type
 115 | ERROR | Missing parameter type
 117 | ERROR | Missing parameter type
 119 | ERROR | Missing parameter type
 142 | ERROR | Missing parameter type
-------------------------------------------------------------------------

And it seems silly to fix things that are just not relevant anymore.

Re the PHPStan issues - I think we should address all of that in the follow-up - 🐛 PHPStan issue report in gitlab Active

🇬🇧United Kingdom alexpott 🇪🇺🌍

Let's not add this to the dictionary - it is not a word.

We can added it to the phpcs.xml.dist file like so:

<?xml version="1.0" encoding="UTF-8"?>
<!-- cspell:ignore Openercase -->
<ruleset name="drupal_core">
🇬🇧United Kingdom alexpott 🇪🇺🌍

Committed and pushed 967e3af639f to 11.x and d6d4d9cd564 to 11.2.x. Thanks!

🇬🇧United Kingdom alexpott 🇪🇺🌍

I've searched the code for any conditions on drupal's version or PHP version and have fixed what I found.

🇬🇧United Kingdom alexpott 🇪🇺🌍

@berdir yay! No regressions :)

🇬🇧United Kingdom alexpott 🇪🇺🌍

We need to land 📌 Drop Drupal 9 and PHP 7 support Active first.

🇬🇧United Kingdom alexpott 🇪🇺🌍

@krystalcode great point about the Drupal 9 support - agreed with @Berdir that we're going to drop that in 📌 Drop Drupal 9 and PHP 7 support Active - dropping Drupal 9 support doesn't break their sites FWIW.

Production build 0.71.5 2024