Philadelphia
Account created on 27 October 2008, almost 16 years ago
#

Merge Requests

More

Recent comments

🇺🇸United States AaronBauman Philadelphia

Neither js nor onclick are accessible, so this presents a significant access barrier.

Why can't an anchor tag ie. <a> be an option?

🇺🇸United States AaronBauman Philadelphia

Merged to 5.1.x dev

Thanks for the contrib

🇺🇸United States AaronBauman Philadelphia

aaronbauman created an issue.

🇺🇸United States AaronBauman Philadelphia

Maybe I'm missing something, but this patch works for me.

Very simply: we already have everything we need to generate the route from the view.

🇺🇸United States AaronBauman Philadelphia

The patch in the referenced issue does not solve the problem for me.

🇺🇸United States AaronBauman Philadelphia

aaronbauman created an issue.

🇺🇸United States AaronBauman Philadelphia

This change does not fix the problem for me.

Still having the same issue as described in 🐛 Exposed Form Reset button Inherits the page display URL when using as a block and AJAX Closed: duplicate and various others marked duplicate or referencing this issue.

🇺🇸United States AaronBauman Philadelphia

The suggestion in #6 does not fix the issue for me.

Reset button still causes a redirect to the attached page display's URL, rather than reloading the current URL.

Not sure if straight duplicate, but seems like this is a core issue also.
🐛 Viewsform has incorrect form submit url if loaded through ajax Needs work

🇺🇸United States AaronBauman Philadelphia

found it: the "show the amount of results" toggle on the facet edit form.

🇺🇸United States AaronBauman Philadelphia

you need to hook this controller up to a route, e.g. via your example_module.routing.yml file

for my use case, i used the path 'login' like so:

example_module.auto_login:
  path: 'login'
  defaults:
    _title: 'Login'
    _controller: '\Drupal\example_module\Controller\AutoLoginController'
  requirements:
    _access: 'TRUE'

Then, for a "deep link", just prefix any path with login?destination=

🇺🇸United States AaronBauman Philadelphia

Thanks for the MR, i've merged latest changes from 5.1.x

This is looking good, but won't get merged into a release until at least 11.0 stable is released.

May need to go into a new major release or point release, depending on 10.3 compatibility.

I'll leave comments in gitlab when we're closer to that point.

🇺🇸United States AaronBauman Philadelphia

Yes, i will update those.

And i'm going to push a 5.0.6 with bug fixes, and possibly more so long as D10.2 is supported.

fwiw:
5.0.x is the <= 10.2 branch
5.1.x is the >= 10.3 branch

🇺🇸United States AaronBauman Philadelphia

Have you run with this patch?

Historically, we compare the SF updated date to Drupal updated date to prevent race conditions between the two systems.
ie. same record updated in both systems between cron runs: we use this date comparison to decide precedence.

seems like this change probably won't have ill effect for the default scenario.
but I am wary that there's some even further edge case where we're relying on this behavior e.g. to prevent some kind of recursion.

how about if, rather than always use LastModified for comparison in PullBase, we fall back on it only if getPullTriggerDate() returns a non-date?

something like this maybe?

       $pull_trigger_date =
-        $sf_object->field($mapping->getPullTriggerDate());
+        $sf_object->field($mapping->getPullTriggerDate()) ?? $sf_object->field('LastModifiedDate');
       $sf_record_updated = $pull_trigger_date ? strtotime($pull_trigger_date) : 0;
 
       $mapped_object
🇺🇸United States AaronBauman Philadelphia

The "doesPush" check is not in the queue handler, but in the hook_cron implementation in salesforce_push.module

You could add "$queue->processQueues($mappings);" to your own cron implementation to achieve the same result, without any patch.

🇺🇸United States AaronBauman Philadelphia

Thank you. Bumped and will be included in 5.1.1 release

🇺🇸United States AaronBauman Philadelphia

Opened bug report against 10.2 with MR of same cherry-pick, please review: 🐛 Admin page access denied even when access is given to child items Needs review

🇺🇸United States AaronBauman Philadelphia

Not clear to me what the issue is either, but the suggested fix of removing the offending twig files fixed it for me as well.

Here's a related core issue, though not clear that it's actually a core problem or how to recreate with only core: 🐛 array_diff(): Argument #2 must be of type array, null given in array_diff() (line 702 [...] core/lib/Drupal/Core/Theme/Registry.php) Postponed: needs info

I will open a MR with the suggested fix as a temporary workaround.

🇺🇸United States AaronBauman Philadelphia

Created MR from patch #3

Back to needs review to make sure it still works.

🇺🇸United States AaronBauman Philadelphia

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

🇺🇸United States AaronBauman Philadelphia

gah, sorry! i'll more the MR over there.

🇺🇸United States AaronBauman Philadelphia

cross-linking new issue with MR

🇺🇸United States AaronBauman Philadelphia

This doesn't work for me in 8.x-1.x branch

🇺🇸United States AaronBauman Philadelphia

Please reconsider?

Even if Gin is admin only theme, it seems weird to have magic hidden settings that can't be accessed or edited from blocks UI.

Since breadcrumbs are assigned via system block ui, why not implement this with block visibility settings, and allow users to override if they wish?

🇺🇸United States AaronBauman Philadelphia

+1 for this feature request

🇺🇸United States AaronBauman Philadelphia

i just required it directly, rather than relying on simplesamlphp

composer require symfony/framework-bundle:6.4.3

🇺🇸United States AaronBauman Philadelphia

AaronBauman created an issue.

🇺🇸United States AaronBauman Philadelphia

Looks like this is a bug with symfony/framework-bundle :
https://github.com/symfony/symfony/pull/57297

For me, I resolved it by rolling back to symfony/framework-bundle 6.4.3 but other version will probably work also.

🇺🇸United States AaronBauman Philadelphia

OK, you're right, seems to have been resolved by #3356717

🇺🇸United States AaronBauman Philadelphia

The primary conflict is the logic Gin uses in GinContentFormHelper::isContentForm and the paragraphs layout implementation.

When the paragraphs layout renders a subform inside a node form, Gin flags the subform as a content form, breaking the actions on the node form.

Since #3356717 does not change that logic, the problem persists regardless.

🇺🇸United States AaronBauman Philadelphia

patch #21 does not solve the problem for me

🇺🇸United States AaronBauman Philadelphia

Generally the process goes like:
1. issue reported (here on d.o) and patched
2. issue gets fixed in dev version
3. new release gets published

during (1), you will need to maintain the patch on your own install.
during (2), you can either keep using the patch, or upgrade to the latest dev version
during (3), you can update to the latest release

The OP doesn't describe the user-facing symptom, so probably would have been difficult to identify these as the same issue.

🇺🇸United States AaronBauman Philadelphia

Tested briefly, and working with the following composer.json configuration.

    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8",
            "exclude": [
                "drupal/key",
                "drupal/typed_data",
                "drupal/salesforce"
            ]
        },
        {
            "type": "package",
            "package": {
                "name": "drupal/key",
                "version": "dev-3395824-allow-drupal-11-installation",
                "type": "drupal-module",
                "source": {
                    "type": "git",
                    "url": "https://git.drupalcode.org/issue/key-3395824",
                    "reference": "3395824-allow-drupal-11-installation"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "drupal/typed_data",
                "version": "dev-3449149-drupal-11-release-8.x-1.x",
                "type": "drupal-module",
                "source": {
                    "type": "git",
                    "url": "https://git.drupalcode.org/issue/typed_data-3449149",
                    "reference": "3449149-drupal-11-release-8.x-1.x"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "drupal/salesforce",
                "version": "dev-3449141-drupal-11",
                "type": "drupal-module",
                "source": {
                    "type": "git",
                    "url": "https://git.drupalcode.org/issue/salesforce-3449141",
                    "reference": "3449141-drupal-11"
                }
            }
        }
    ],

🇺🇸United States AaronBauman Philadelphia

Committed and released in 5.0.5 and 5.1.0

🇺🇸United States AaronBauman Philadelphia

Committed and released in 5.0.5 and 5.1.0

Thanks all

🇺🇸United States AaronBauman Philadelphia

opened MR!10 against 2.x and MR!11 against 8.x-1.x

🇺🇸United States AaronBauman Philadelphia

AaronBauman created an issue.

🇺🇸United States AaronBauman Philadelphia

Would be nice to get an explainer of how to do this *without* ddev

🇺🇸United States AaronBauman Philadelphia

Here's the deriver i'm using for the curious:

/**
 * @file
 * Contains \Drupal\media_analysis\Plugin\Derivative.
 */

namespace Drupal\media_analysis\Plugin\Derivative;

use Drupal\Component\Plugin\Derivative\DeriverBase;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
use Drupal\media_analysis\HookImplementations;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Provides block plugin definitions for nodes.
 *
 * @see \Drupal\media_analysis\Plugin\QueueWorker\MediaAnalysisWorker
 */
class MediaAnalysisWorker extends DeriverBase implements ContainerDeriverInterface {

  /**
   * Constructor.
   *
   * @param \Drupal\Core\Entity\EntityStorageInterface $node_storage
   *   The node storage.
   */
  public function __construct(private readonly EntityStorageInterface $nodeStorage) {
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, $base_plugin_id) {
    return new static(
      $container->get('entity_type.manager')->getStorage('node')
    );
  }

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    $nodes = $this->nodeStorage->loadByProperties(['type' => 'media_channel']);
    foreach ($nodes as $node) {
      $this->derivatives[$node->id()] = $base_plugin_definition;
      $this->derivatives[$node->id()]['admin_label'] = t('Channel: ') . $node->label();
    }
    return $this->derivatives;
  }

}

This deriver then gets referenced in the @Cron annotation field of my existing cron queue worker:

/**
 * Defines 'media_analysis' queue worker.
 *
 * @QueueWorker(
 *   id = "media_analysis",
 *   title = @Translation("Media Analysis: Channels"),
 *   cron = {"time" = 60},
 *   deriver = "\Drupal\media_analysis\Plugin\Derivative\MediaAnalysisWorker"
 * )
 */

And I have another procedure to insert queue items with a queue name like media_analysis:$nid which then get processed by the queue worker, thanks to Derivative API.

The derivative is mostly useful so that I can more easily prevent duplicate queue items, but it breaks the Queue UI pretty badly.

I started looking at adapting Queue UI, but it's a bit of a can of worms - will require special handling for every route and callback that uses the {queueName} placeholder, for starters.
So IMO it's fine to leave this issue on Postponed, and I'll implement a custom UI for my special case.

🇺🇸United States AaronBauman Philadelphia

Not sure what I was looking at, but the item count for subqueues looks fine in fact.

🇺🇸United States AaronBauman Philadelphia

Here's what I managed to put together.
It's a controller for an "automated login" route - any auth requests directed to this URL will be redirected to ?destination, or a default page if ?destination is not given.
Any anon requests directed to this URL will be redirected to Open ID login via the ::authorize method of the Open ID provider - in this case "generic"


<?php

namespace Drupal\example_module\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Routing\TrustedRedirectResponse;
use Drupal\openid_connect\OpenIDConnectClaims;
use Drupal\openid_connect\Plugin\OpenIDConnectClientManager;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RequestStack;

/**
 * Returns responses for auto-login route.
 */
final class AutoLoginController extends ControllerBase {

  /**
   * The controller constructor.
   */
  public function __construct(
    private readonly RequestStack $requestStack,
    private readonly OpenIDConnectClaims $claims,
    private readonly OpenIDConnectClientManager $pluginManager
  ) {}

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container): self {
    return new self(
      $container->get('request_stack'),
      $container->get('openid_connect.claims'),
      $container->get('plugin.manager.openid_connect_client')
    );
  }

  /**
   * Builds the response.
   */
  public function __invoke() {
    if ($this->currentUser()->isAuthenticated()) {
      $redirect = $this->requestStack->getCurrentRequest()->query->get('destination') ?? $this->getDefaultPage();
      return (new TrustedRedirectResponse($redirect))->addCacheableDependency($this->currentUser);
    }
    $this->saveDestination();

/*** CHANGE openid_connect.settings.generic TO AS APPROPRIATE FOR YOUR OPEN ID PLUGIN ****/
    $configuration = $this->config('openid_connect.settings.generic')
      ->get('settings');
/*****************************************************************************************/

    /** @var \Drupal\openid_connect\Plugin\OpenIDConnectClientInterface $client */
    $client = $this->pluginManager->createInstance(
      'generic',
      $configuration
    );
    $scopes = $this->claims->getScopes($client);
    $_SESSION['openid_connect_op'] = 'login';
    return $client->authorize($scopes);
  }

  /**
   * Helper.
   */
  protected function saveDestination() {
    // The destination could contain query parameters. Ensure that they are
    // preserved.
    $_SESSION['openid_connect_destination'] = [
      $this->requestStack->getCurrentRequest()->query->get('destination') ?? $this->getDefaultPage()
    ];
  }

  /**
   * Helper.
   */
  protected function getDefaultPage() {
    return '/example';
  }

}
🇺🇸United States AaronBauman Philadelphia

None of these are invoked when the paragraph form is rendered:

  • hook_field_widget_single_element_paragraphs_form_alter
  • hook_common_field_widget_complete_paragraphs_form_alter
  • hook_field_widget_paragraphs_form_alter

Can someone please advise what is the up to date method of altering the paragraph form?

Seems like this should be in paragraphs.api.php

🇺🇸United States AaronBauman Philadelphia

Ah, thank you for the additional info.

Dropping support for D9 makes sense to me.
I'm not interested in supporting any unsupported Drupal core versions.

🇺🇸United States AaronBauman Philadelphia

Drupal core requires guzzle 7, which includes this method.
Unless you have a very compelling use case, this is "won't fix"

🇺🇸United States AaronBauman Philadelphia

Is this still an issue?

🇺🇸United States AaronBauman Philadelphia

MR 415 opened with same patch from #4

🇺🇸United States AaronBauman Philadelphia

Here's a patch that adds an additional alter hook so that nested forms can be excluded by id.

Solved the conflict with contact block for me using the following implementation:

function my_module_gin_form_ids_to_ignore_alter(array &$ids) {
  $ids[] = 'contact';
}
🇺🇸United States AaronBauman Philadelphia

Breaks https://www.drupal.org/project/contact_block as well, when you add a Contact Block to a node via the paragraph.

Cross-linking 🐛 Gin + Paragraph Layouts conflict Active

🇺🇸United States AaronBauman Philadelphia

The comment is perhaps unclear.
A clearer comment might be:

// If $value is TypedData, it should have been set during pullValue(), so we don't need to set it again here.
🇺🇸United States AaronBauman Philadelphia

Updated to search_api_solr 4.3.1 and solarium 6.3.5, and applied patch #15
Suggester is enabled, and buildOnCommit is off

Still getting the timeout errors in logs, not sure what else to do.

🇺🇸United States AaronBauman Philadelphia

Yeah, I did see that - very cool!

Looks like BEF tests are failing, but this one passes, so ... i assume that's a known issue and this is closeable.
https://git.drupalcode.org/issue/better_exposed_filters-3393662/-/jobs/1304335

🇺🇸United States AaronBauman Philadelphia

Doesn't seem like it's still happening, but let's see what testbot says.

Here's a re-roll of the TEST-ONLY patch against latest dev.

🇺🇸United States AaronBauman Philadelphia

Thanks for the patch.
I haven't seen this issue on any of my own projects, can you please provide more background?

🇺🇸United States AaronBauman Philadelphia

You need to add the oauth URL of your Drupal site to the Salesforce app.

also: you're using interactive OAuth, but the recommended auth plugin is JWT
see quick start: https://www.drupal.org/docs/contributed-modules/salesforce-suite/quick-s...

🇺🇸United States AaronBauman Philadelphia

Best I can tell, looks like you're on an old version.
The line numbers don't match up with 5.0.4 or 5.0.x, and this was fixed in 5.0.3

The issue with UniqueFieldsConstraintValidator was addressed here:
🐛 Entity queries must explicitly set whether the query should be access checked or not Fixed
and here: https://git.drupalcode.org/project/salesforce/-/commit/48bcdc174373ec082...

🇺🇸United States AaronBauman Philadelphia

The access check is performed upon the query itself in \Drupal\salesforce_mapping\SalesforceMappingStorage::loadByProperties

  /**
   * {@inheritdoc}
   */
  public function loadByProperties(array $values = []) {
    // Build a query to fetch the entity IDs.
    $entity_query = $this->getQuery()->accessCheck(FALSE);
    $this->buildPropertyQuery($entity_query, $values);
    // Sort by the mapping weight to ensure entities/objects are processed in
    // the correct order.
    $entity_query->sort('weight');
    $result = $entity_query->execute();
    return $result ? $this->loadMultiple($result) : [];
  }

SalesforceMappingStorage is just a wrapper.

If you're still having this issue, can you please share a full stack trace?

🇺🇸United States AaronBauman Philadelphia

Merged to dev, thanks for the patch

🇺🇸United States AaronBauman Philadelphia

Thanks for the feedback, i'll followup here if i get a chance to dig into it.

🇺🇸United States AaronBauman Philadelphia

Please update to 5.0.4 or 5.0.x-dev

Update to support Address v2 Fixed

🇺🇸United States AaronBauman Philadelphia

Yes, this could probably use some work.

My priority around delete queue is an overhaul, started here: 📌 Convert delete handling into a queue Needs work

This request should get rolled up into that work.

🇺🇸United States AaronBauman Philadelphia

That's great, thanks for the MR.
Surprised ckeditor doesn't have a default value in the first place, and agree that it would be silly to add test coverage for a 3rd party library.

Anyone know if there's a similar issue open for the link widget already?
That's another super annoying UX / validation constraint when protocol is missing.

Production build 0.71.5 2024