Newburgh, NY
Account created on 26 January 2005, over 19 years ago
#

Merge Requests

Recent comments

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

@mglaman yep. I thought "Basic site info" would be a good place for it because email is there too. It feels like that form is the core identity of the site.

Also, if Drupal core had this feature, it could set DRUPAL_ENV to prod only if the URL matches. It would be a very simple way to detect environment on any system. No more if/then/else clutter in settings.php.

A comment by Ryan Price on linkedin brought up "trusted hosts"... Maybe we need a "trusted prod hosts"?

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

I coincidentally installed metatags on my site yesterday, and it has a field "Canonical URL".

Did a little digging. Seems like this could be useful for printing these tags.

https://developers.google.com/search/docs/crawling-indexing/canonicaliza...

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Matt: Yes, this is specifically for the prod URL. Can be used both for showing admin users in the status report page, and for detecting if a site is "live" or not.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Added "category" to plugin definition to tell it where to display.

"site" category is for things that don't change across environments, like install profile or install time.

"environment" category is for things that are specific to that environment, such as PHP version and Drupal version.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Development on this feature has moved to ✨ Add "system.site" service to access information about the site. Active . Keeping this issue for discussing the Main URL field specifically.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Update: After thinking a few days I think "Main URL" is the best human-readable name for this property.

"Canonical URL" is still good for the backend, I think. "Main URL" is a little vague when used in code.

Thoughts?

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Like

SiteService::isCanonical() as a universal way to see if a site is "live" or not.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Matt: I'm thinking Main URL is a good human label, but like canonical for the property name.

Open to whatever.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

@matt: is the APP_URL for the current site? Or as a reference for the live site?

This is to store the live site so users can see it in status reports etc.

I think the screenshot is confusing. The default value is whatever site you are on, hence "localhost" because I was using PHP CLI server, but normally you would put in a separate domain.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Could we send this to the new contributors team?

Would make a great first contribution for someone!

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY
πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY
πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Jon Pugh β†’ created an issue. See original summary β†’ .

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

I made a library to try and set settings.php for all host providers.

If the host provider doesn't set the env var, we can putenv() from the host vendor code. (Platform, ddev, etc)

Then $databases can always be set from envs.

https://github.com/operations-project/drupal-settings/blob/2.x/Settings%...

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

The file is for devshop, it will need to be updated for aegir.

I'll try to set aside some time this week to do this.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

MathMadd I think that can happen if migrate_tools is not enabled which can happen if you installed path_redirect_import before version 2.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Is that a problem people are having? Migrate Tools is not installed?

The dependency on migrate_tools was only added a year ago and I am not seeing an update hook to enable it.

https://git.drupalcode.org/project/path_redirect_import/-/commit/b0c4dd1...

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Both modules have made the change needed in dev branches only.

Until there is a new release, you have to require the dev versions.

composer require drupal/path_redirect_import:2.0.x-dev drupal/migrate_tools:6.0.x-dev

To confirm, open up the files PathRedirectImportCommands.php and MigrateToolsCommands.php, and check the namespace.

In path_redirect_import, it reads:

use Drupal\migrate_tools\Drush\Commands\MigrateToolsCommands;

In MigrateToolsCommands it should read:

namespace Drupal\migrate_tools\Drush\Commands;

HOWEVER....

It still doesn't work on my site, because somehow, Migrate Tools was disabled but path_redirect_import is still enabled.

Maybe this will work for you?

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Passing to Drupal.org project queue.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Jon Pugh β†’ made their first commit to this issue’s fork.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY
πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

This is a crazy hack. This patch has to be used in devshop control (composer-based hostmaster.)

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY
πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

I didn't patch against the right repo. new patches attached.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

I'm not sure if bad path mappings should be ignored or exceptions should be thrown.

Here are two patches for each possibility.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Attached is a patch for drush 8 to make it compatible with symfony/console 5+, which allows hostmaster commands to run against drupal 10 sites.

Provision has a composer.json file, which can include patches.

Hostmaster can be built using a composer.json file. See https://github.com/opendevshop/devshop/blob/1.x/src/DevShop/Control/comp...

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Came across this issue when upgrade a site from 9 to 10.0 using bricks.module.

From debugging I traced it down to this: Bricks.module is now showing a field "revision_id" that does not exist in $field_definitions.

The error comes when trying to run the update hooks so I can't update any schemas.

Applying the patch worked.

Attached is a new patch for 10.0.x

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Jon Pugh β†’ made their first commit to this issue’s fork.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Fixed. rc2 coming up.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Patch applied. Thanks!

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Removed the patch completely. It's only needed when using views.

I added help text to the README about the patches.

To test:

composer require drupal/site:2.x-dev

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

For anyone looking, the patch for the above MR can be viewed here: https://git.drupalcode.org/project/drupal/-/merge_requests/4953.patch

Uploading it here for testing.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

You can work around this by setting the intercom/intercom-php library version in your composer:

composer require drupal/intercom intercom/intercom-php:"^3 || ^4" -W

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Marking needs review to get some attention.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Thanks apaderno!

Strange thing, though ... I'm not seeing content on the planet feed? I went back 3-4 pages.

https://www.drupal.org/planet β†’

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Can I get this reviewed again? New content is up.

Thanks!

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Jon Pugh β†’ created an issue.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

DevShop runs hosting 4.x and provision 4.x in a composer platform, which includes drush8.

Then, drush 10/11 is installed globally.

Running drush @hostmaster works, properly passes from drush 11 to site-local drush8 in hostmaster.

https://github.com/opendevshop/devshop/blob/1.x/src/DevShop/Control/comp...

It uses provision 4.x and hosting 4.x branch, which is just a stopgap for current generation. Lots of hacks to get DevShop more stable. I added drush9+ yml alias ge eration so "drush sa" works with both drush 8 and 9+.

If someone wants to take this back to aegir, feel free.

It works.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

FWIW I am still getting the error. I had to fully remove the .behat.inc files to get bin/behat to run.

drupal/lightning_core * 5.14.0
behat/behat v3.13.0
drupal/drupal-extension v5.0.0rc1

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

The problem is that the entity that is referenced is missing.

The new MR is against 3.2.x. It simply returns "" for a label if none is found. This is important because the relation entity still exists, so in order to be clickable, label has to be something.

See https://git.drupalcode.org/project/group/-/merge_requests/107

This is what it looks like:

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

For clarity, this is what I did to cause this error:

In a custom Deriver class, getDerivativeDefinitions method, I changed this:

      $this->derivatives[$name]->set('label', t('Organization site (@type)', ['@type' => $label]));

to this:

      $this->derivatives[$name]->set('label', t($label));

Instead of doing logic checks, I think it would be simpler to create a setLabel() method so that you could force the parameter to be TranslatableMarkup. There is already a getLabel() method.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Add specifics about Site UUID and config exports.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

In order for this to be accepted, please include changes to automated tests to check for additional violations.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

I am with you on DDEV. It has much better MacOS support, right? I use ubuntu for daily driver. Even then installing lando takes a deb tweak.

I struggled to get multisite to work in Lando. It would not work properly with a single container.

If you had the bandwidth to submit a MR with ddev config, I would merge it.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Actually I think I fixed this in my most recent branch.

I'm planning on merging today.

See feature/project-fields branch

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Check settings.php at the bottom. Sometimes drush adds the MySQL credentials which is wrong. The creds are set automatically for each separate site.

Remove the $databases array and try.again.

Just to confirm, using 2.x branch?

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Catch missing user and improve messaging.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Here's what it looks like:

www-data@7840126ff815:~$ drush key:set admin

In KeyAuthCommands.php line 64:
                                                                 
  User already has API key. Use --force option to overwrite it.  
                                                                 

www-data@7840126ff815:~$ drush key:set admin --force

 ! [NOTE] User's existing API key was removed.                                             

 [success] API key for user admin was set to 9a99e567bbd5983beb318274baf96273.
www-data@7840126ff815:~$ drush key:set admin abc123 --force

 ! [NOTE] User's existing API key was removed.                                             

 [success] API key for user admin was set to abc123.
πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

I created a new branch and merge request to add a drush command: 'key:set'

Patch attached.

MR here: https://git.drupalcode.org/project/key_auth/-/merge_requests/13

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

I don't recommend this approach in the core module.

However I too need the ability to insert an existing key.

My use case is for testing and development of a number of sites at once. I want to hard code a key into the development settings so that I don't have to generate a new one and set it in the client everytime I install or sync the site in.

To add a key, just set the api_key field on users. Custom code or an add on module for managing keys could be created.

See UserKeyAuthForm::submitForm():

 // Generate a new key.
    User::load($form['#uid'])
      ->set('api_key', $this->keyAuth->generateKey())
      ->save();
πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

I would like to take over this project namespace for a different purpose, to track back-end tasks for site module β†’ .

There is a Drupal 9+ replacement for this module, Tasks Module β†’ .

There was a 8.x development release here, but virtually zero usage.

Is it ok to start something new here?

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Fixed it! (I think?)

The crazy bundle field definitions we are doing. We needed to reset the keyvalue cache for fields.

Not sure why. Looks like we could make some core improvements here.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY
πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Other thoughts...

I would like to separate Site.module from the Site API & Manager connection stuff at some point.

Some sites will just use Site.module for the content entity. I don't think we should force them to enable JSONAPI unless they need to.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Closed as duplicate of πŸ“Œ Fix the issues reported by phpcs Needs work

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

2.x is the new branch. Please rebase the MR.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Same thing happens when saving a view.

Drupal Config API converts these complex config objects to YAML at some point, storing it or writing it to files.

We should research how that happens and do the same when saving it.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

I've removed all of the automated reassignment/deletion of content when a user is deleted.

It's not really content, so I just removed it.

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Login link is no longer in the view display.

Production build 0.69.0 2024