🇬🇧United Kingdom @andybroomfield

Account created on 1 November 2009, about 16 years ago
#

Merge Requests

More

Recent comments

🇬🇧United Kingdom andybroomfield

andybroomfield created an issue.

🇬🇧United Kingdom andybroomfield

After a little investigation, I was able to get this working by adding
use Drupal\mercury_editor\Ajax\IFrameAjaxResponseWrapper
and injecting the iFrameAjaxResponseWrapper

  protected $iFrameAjaxResponseWrapper;

  /**
   * {@inheritDoc}
   */
  public function __construct(LayoutParagraphsLayoutTempstoreRepository $tempstore, $iFrameAjaxResponseWrapper) {
    $this->tempstore = $tempstore;
    $this->iFrameAjaxResponseWrapper = $iFrameAjaxResponseWrapper;
  }

  /**
   * {@inheritDoc}
   */
  public static function create(ContainerInterface $container) {
    return new static(
      $container->get('layout_paragraphs.tempstore_repository'),
      $container->get('mercury_editor.iframe_ajax_response_wrapper')
    );
  }

Then replacing the response with Mercury editors iframe wrapper

      $this->iFrameAjaxResponseWrapper->addCommand(new ReplaceCommand('[data-uuid="' . $component_uuid . '"] .lpb-controls-publish-toggle', $rendered_item));
      $this->iFrameAjaxResponseWrapper->addCommand(new InvokeCommand('[data-uuid="' . $component_uuid . '"]', 'toggleClass', ['paragraph--unpublished']));
      $this->iFrameAjaxResponseWrapper->addCommand(new LayoutParagraphsEventCommand($this->layoutParagraphsLayout, $paragraph->uuid(), 'component:update'));
      $response->addCommand($this->iFrameAjaxResponseWrapper->getWrapperCommand());

Obviously above is not practical as many sites will be using Layout paragraphs without Mercury editor.

🇬🇧United Kingdom andybroomfield

andybroomfield created an issue.

🇬🇧United Kingdom andybroomfield

Also using user 1. Maybe this effects other user roles?

🇬🇧United Kingdom andybroomfield

Database and memcache.
Just testing locally though.
Are the steps to replicate

  1. Add pdf to import
  2. Run drush lpii or crib
  3. Reload the import view.

I see the state change from pending to done.
Looking at the change though, I think it’s small enough to approve as I didn’t see any side effects after applying.

🇬🇧United Kingdom andybroomfield

I'm not replicating the issue, even with all caching turned on.
Are there some specific steps to replicate?
Otherwise the change seems small enough we could just go with it.

🇬🇧United Kingdom andybroomfield

Have checked and this allows cron to be enabled / disabled, and the correct number of imports is run on cron.

🇬🇧United Kingdom andybroomfield

Have checked out branch and verified the update that this is all working.
Only thing would be if we wanted to change the view name if updating the machine name would be relevant, that could be a new issue.

🇬🇧United Kingdom andybroomfield

andybroomfield created an issue.

🇬🇧United Kingdom andybroomfield

Have tested this with default LGD install and by adding extra channel (country) to the LGD collaborators. This is working for me.

🇬🇧United Kingdom andybroomfield

Just to flag, this patch will break Mercury editor as that relies on calling the getParagraph method.
Is there a way to support both (perhaps deprecating the getParagraph method?)

🇬🇧United Kingdom andybroomfield

MR open for review.
Not sure if we need tests on this.
Note, to use existing blocks will need to be disabled, and templates will need to be layout builder aware (I've made the change for the included node--localgov-services-landing--full.html.twig template in the module, but to use layout builder with localgov_base derived themes a similar change will need to be made.
Otherwise this is mostly refactoring blocks, so the underlying change makes sense anyway (use node context instead of relying on the path route to determine the node).

🇬🇧United Kingdom andybroomfield

andybroomfield changed the visibility of the branch 3563437-add-layout-builder to hidden.

🇬🇧United Kingdom andybroomfield

Fixed in 2.2.2.

🇬🇧United Kingdom andybroomfield

Patch added above.

🇬🇧United Kingdom andybroomfield

I have a draft PR adding support for Better exposed filters and a custom filter plugin that allows for them to be split.
Appreciate that's a new dependency, though in general use of facets with exposed filters requires Better exposed filters are used if you want checkboxes.

🇬🇧United Kingdom andybroomfield

+1 for me

🇬🇧United Kingdom andybroomfield

FWIW Brighton has made this change with Directories and Events, we now use exposed facets with facets 3 so we can use Ajax.
It would be good to support this out the box.

🇬🇧United Kingdom andybroomfield

andybroomfield created an issue.

🇬🇧United Kingdom andybroomfield

andybroomfield created an issue.

🇬🇧United Kingdom andybroomfield

Opened merge request with patch.

🇬🇧United Kingdom andybroomfield

Looking closely, this is tied to having the element on a multiple page form.
Here's an example

page_one:
  '#type': wizard_page
  '#title': 'Page one'
  fieldset:
    '#type': fieldset
    '#title': Fieldset
    dropzone:
      '#type': webform_dropzonejs
      '#title': Dropzone
      '#multiple': true
page_two:
  '#type': wizard_page
  '#title': 'Page two'
  fieldset_2:
    '#type': fieldset
    '#title': 'Fieldset 2'
    some_text:
      '#type': textarea
      '#title': 'Some text'
🇬🇧United Kingdom andybroomfield

andybroomfield created an issue.

🇬🇧United Kingdom andybroomfield

andybroomfield created an issue.

🇬🇧United Kingdom andybroomfield

Added MR with fix by removing the canonical link definition since no route definition.

🇬🇧United Kingdom andybroomfield

For details why the included VCS repo inside the composer.json doesn't work: https://getcomposer.org/doc/faqs/why-cant-composer-load-repositories-rec...

🇬🇧United Kingdom andybroomfield

In mean time, doing a search and replace for
\d+: with -: in the effected user.role.*.yml files resolves the problem.

🇬🇧United Kingdom andybroomfield

I was here! (Showed single content sync and collapsible alert banner)

🇬🇧United Kingdom andybroomfield

Have tested this on BHCC site and geo entities remain editable.
Was able to change the permission to edit and delete own and those functions where only possible on Geo entities a user was the author.
I noticed a weird side effect which is when a geo entity that a user can view but not edit, when trying to edit in the entity browser, it removes it from the selection and switches to replace mode, instead of the opening up the editor. I guess this is intended behaviour (and from entity browser anyway).

My only further thoughts are if we need per bundle permissions. As we now have quite a few Geo bundles (mostly for connecting and importing the data from ArcGis). So generally we would not want normal Drupal editors to have permission to delete those. Happy for that to be an advanced permission sub module.

🇬🇧United Kingdom andybroomfield

Just testing this with BHCC site. I'm testing MR 14.

On default Localgov Drupal I see the permissions update.

Before:

After:

🇬🇧United Kingdom andybroomfield

Have tested the patch and the fix applied in #3480411 still applies for both leaflet widget and geo field widget.

🇬🇧United Kingdom andybroomfield

Not sure why the tests are failing for @hannahdigidev MR. I've run the test suite locally with PHP 8.3 and 8.4 and they all pass.

% /opt/homebrew/opt/php@8.4/bin/php vendor/bin/phpunit web/modules/contrib/geo_entity --testdox
PHPUnit 9.6.23 by Sebastian Bergmann and contributors.

Testing [redacted]/web/modules/contrib/geo_entity
Address Forms (Drupal\Tests\geo_entity_address\Functional\AddressForms)
✔ Crud

Geonames Service (Drupal\Tests\geo_entity_tz\Unit\GeonamesService)
✔ Config missing
✔ Error
✔ Response

Geo Bundle Creation (Drupal\Tests\geo_entity\Functional\GeoBundleCreation)
✔ Media type creation form

Geo Overview Access (Drupal\Tests\geo_entity\Functional\GeoOverviewAccess)
✔ Overview page access

Time: 00:19.076, Memory: 22.48 MB

OK (6 tests, 51 assertions)

Remaining self deprecation notices (14)

2x: \Drupal\Core\Render\Element\FormElement::processGroup() is deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Use \Drupal\Core\Render\Element\FormElementBase::processGroup() instead. See https://www.drupal.org/node/3436275
2x in AddressFormsTest::testCrud from Drupal\Tests\geo_entity_address\Functional

2x: \Drupal\Core\Render\Element\FormElement::valueCallback() is deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Use \Drupal\Core\Render\Element\FormElementBase::valueCallback() instead. See https://www.drupal.org/node/3436275
2x in AddressFormsTest::testCrud from Drupal\Tests\geo_entity_address\Functional

1x: \Drupal\Core\Render\Element\FormElement::preRenderGroup() is deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Use \Drupal\Core\Render\Element\FormElementBase::preRenderGroup() instead. See https://www.drupal.org/node/3436275
1x in AddressFormsTest::testCrud from Drupal\Tests\geo_entity_address\Functional

1x: Renderer::renderPlain() is deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Instead, you should use ::renderInIsolation(). See https://www.drupal.org/node/3407994
1x in AddressFormsTest::testCrud from Drupal\Tests\geo_entity_address\Functional

1x: Drupal\geo_entity_tz\GeonamesTimezone::getTimezone(): Implicitly marking parameter $radius as nullable is deprecated, the explicit nullable type must be used instead
1x in GeonamesServiceTest::testConfigMissing from Drupal\Tests\geo_entity_tz\Unit

1x: Drupal\geo_entity_tz\GeonamesTimezone::timezoneRequest(): Implicitly marking parameter $radius as nullable is deprecated, the explicit nullable type must be used instead
1x in GeonamesServiceTest::testConfigMissing from Drupal\Tests\geo_entity_tz\Unit

1x: Drupal\geo_entity_tz\GeonamesTimezone::timezoneRequest(): Implicitly marking parameter $lang as nullable is deprecated, the explicit nullable type must be used instead
1x in GeonamesServiceTest::testConfigMissing from Drupal\Tests\geo_entity_tz\Unit

1x: Drupal\geo_entity_tz\GeonamesTimezone::timezoneRequest(): Implicitly marking parameter $date as nullable is deprecated, the explicit nullable type must be used instead
1x in GeonamesServiceTest::testConfigMissing from Drupal\Tests\geo_entity_tz\Unit

1x: Drupal\geo_entity_tz\GeonamesTimezoneInterface::getTimezone(): Implicitly marking parameter $radius as nullable is deprecated, the explicit nullable type must be used instead
1x in GeonamesServiceTest::testConfigMissing from Drupal\Tests\geo_entity_tz\Unit

1x: Drupal\geo_entity_tz\GeonamesTimezoneInterface::timezoneRequest(): Implicitly marking parameter $radius as nullable is deprecated, the explicit nullable type must be used instead
1x in GeonamesServiceTest::testConfigMissing from Drupal\Tests\geo_entity_tz\Unit

1x: Drupal\geo_entity_tz\GeonamesTimezoneInterface::timezoneRequest(): Implicitly marking parameter $lang as nullable is deprecated, the explicit nullable type must be used instead
1x in GeonamesServiceTest::testConfigMissing from Drupal\Tests\geo_entity_tz\Unit

1x: Drupal\geo_entity_tz\GeonamesTimezoneInterface::timezoneRequest(): Implicitly marking parameter $date as nullable is deprecated, the explicit nullable type must be used instead
1x in GeonamesServiceTest::testConfigMissing from Drupal\Tests\geo_entity_tz\Unit

🇬🇧United Kingdom andybroomfield

I've rerolled the original patch as a new MR for compatibility with latest version of Single content sync (1.4.12).
Hopefully done this right! I've tested it with a node that uses layout paragraphs and paragraphs library and it does export with the paragraphs fields contents and able to successfully import on a target site.

🇬🇧United Kingdom andybroomfield

Does the patch in this issue fix the problem?
https://www.drupal.org/project/layout_paragraphs_toggle_publish/issues/3... 🐛 Missing access operation parameter causes incompatibility with scheduled transitions (and possibly other modules) Fixed

I think that was committed to the 1.x not the 1.0.x branch so it's not in the latest release yet.

🇬🇧United Kingdom andybroomfield

See the linked Github issue above:

  1. Create a new directory venue with a brand new geo entity as a location. This should geocode the map pin.
  2. Then edit said directory venue, and edit the location (not delete and replace).
  3. Clear out the address and try to add a new one. Whilst the autocomplete does replace it, the leaflet map pin and lat / lon fields are not updated.
🇬🇧United Kingdom andybroomfield

I'm seeing this issue on Drupal 10.3.9. This is happening on paragraphs and any custom entity (content types seems fine).
It appears to be any field, except the first which opens fine.
Error is
: Undefined array key "localgov_opens_in_a_new_window" in on line

: Trying to access array offset on value of type null in on line

: Trying to access array offset on value of type null in on line

: Trying to access array offset on value of type null in on line

: Trying to access array offset on value of type null in on line

Patch in #2 does resolve this issue.

🇬🇧United Kingdom andybroomfield

Might be a new issue though, this is what we are seeing. The child paragraphs are bleeding out of the container.

🇬🇧United Kingdom andybroomfield

Just to add I'm also seeing this on Gin-rc14 and not using paragraphs EE.

🇬🇧United Kingdom andybroomfield

@cilefen yes, i'm able to get it working with the states.js file from Drupal 10.2 inside of an otherwise 10.3 site.

🇬🇧United Kingdom andybroomfield

Changing
once('geoEntityGeocodeLeaflet', document.getElementById(formId)).forEach(function (form) {
to
once('geoEntityGeocodeLeaflet', document.querySelectorAll('form[id^="' + formId + '"]')).forEach(function (form) {
works. Might not be the most performant though.

🇬🇧United Kingdom andybroomfield

Looking at $entity->get($field) on the node page gives me

Drupal\computed_field\Field\ComputedFieldClass {#2574 ▼
  #definition: 
Drupal\computed_field\Field
\
ComputedFieldDefinition {#2572 ▶}
  #name: "localgov_event_date_occurrence"
  #parent: 
Drupal\Core\Entity\Plugin\DataType
\
EntityAdapter {#2423 ▶}
  #_serviceIds: []
  #_entityStorages: []
  #stringTranslation: null
  #typedDataManager: 
Drupal\Core\TypedData
\
TypedDataManager {#594 ▶}
  #list: []
  #langcode: "en"
  #valueComputed: true
}

On the Search API page I get

Drupal\computed_field\Field\ComputedFieldClass {#9711 ▼
  #definition: 
Drupal\computed_field\Field
\
ComputedFieldDefinition {#9742 ▶}
  #name: "localgov_event_date_occurrence"
  #parent: 
Drupal\Core\Entity\Plugin\DataType
\
EntityAdapter {#9788 ▶}
  #_serviceIds: []
  #_entityStorages: []
  #stringTranslation: null
  #typedDataManager: 
Drupal\Core\TypedData
\
TypedDataManager {#1240 ▶}
  #list: array:1 [▼
    0 => 
Drupal\datetime_range\Plugin\Field\FieldType
\
DateRangeItem {#9688 ▼
      #definition: 
Drupal\Core\Field\TypedData
\
FieldItemDataDefinition {#9741 ▶}
      #name: 0
      #parent: 
Drupal\computed_field\Field
\
ComputedFieldClass {#9711}
      #_serviceIds: []
      #_entityStorages: []
      #stringTranslation: null
      #typedDataManager: 
Drupal\Core\TypedData
\
TypedDataManager {#1240 ▶}
      #values: array:3 [ …3]
      #properties: array:2 [ …2]
    }
  ]
  #langcode: "en"
  #valueComputed: true
}

I traced the NULL value to docroot/core/lib/Drupal/Core/TypedData/ComputedItemListTrait.php which the get method returns NULL if there is no value in the index.

  public function get($index) {
    if (!is_numeric($index)) {
      throw new \InvalidArgumentException('Unable to get a value with a non-numeric delta in a list.');
    }

    // Unlike the base implementation of
    // \Drupal\Core\TypedData\ListInterface::get(), we do not add an empty item
    // automatically because computed item lists need to behave like
    // non-computed ones. For example, calling isEmpty() on a computed item list
    // should return TRUE when the values were computed and the item list is
    // truly empty.
    // @see \Drupal\Core\TypedData\Plugin\DataType\ItemList::get().
    $this->ensureComputedValue();

    return $this->list[$index] ?? NULL;
  }

I think it returns NULL as the ComputeValue of src/Plugin/ComputedField/DateOccurrence.php will return an empty array. I can change this to ['now'] and the entity pages get a dateTime of the current date.

🇬🇧United Kingdom andybroomfield

We're not setting this to anything, it's just a NULL value if it's not computed becuase we're viewing the entity page. it's outside of a search api view. But we get the WSOD even though we don't have the computed field in our manage display. It throws the error regardless.

🇬🇧United Kingdom andybroomfield

This is fixed in localgov_alert_banner 1.7.6.
Thanks for your contribution adinancenci.

🇬🇧United Kingdom andybroomfield

I think this issue might have cropped up again, just trying the config above in fresh webform and experincing this issue.

Production build 0.71.5 2024