πŸ‡«πŸ‡·France @arnaud-brugnon

Account created on 28 November 2014, almost 10 years ago
#

Merge Requests

Recent comments

πŸ‡«πŸ‡·France arnaud-brugnon

Damn it, i was pretty sure that was fixed but i did not found the other ticket.

This is a duplicate, so i close it.

πŸ‡«πŸ‡·France arnaud-brugnon

Here's the fix for InlineParagraphsBrowserWidgetTrait class.

I don't know if there is other cases.

I only solve the one that blocked me.

πŸ‡«πŸ‡·France arnaud-brugnon

Please provide a screenschot of your error, WE may help you.

But i dont think it s related

πŸ‡«πŸ‡·France arnaud-brugnon

#3 works me too (even if i don't really unsterstand why).
Thanks a lot.

πŸ‡«πŸ‡·France arnaud-brugnon

I made a mistake in #15.
I erase the addition of letters.

With that, X-Tag value is nothing more than the value of last letter (a bit annoying).

Sorry about that.
Here's the fix.

@shumer can you publish the fix asap pls ?

πŸ‡«πŸ‡·France arnaud-brugnon

I just publish Drupal 10 support and code improvements.

Enjoy.

πŸ‡«πŸ‡·France arnaud-brugnon

Thanks.

Did you test integration with ckeditor 5 ?

πŸ‡«πŸ‡·France arnaud-brugnon

Thanks for the patch.
Did you test Ckeditor 5 support ?

πŸ‡«πŸ‡·France arnaud-brugnon

Totally agree.

Field config cardinality is so great but integration with entity browser is a bit complicated without the feature.

I just improve the patch a bit : We want field cardinality, so method should be a fetch, not a get ;)

πŸ‡«πŸ‡·France arnaud-brugnon

If you need to upgrade to Drupal 10, don't repositories but patches and lenient

Here's the official doc

https://www.drupal.org/docs/develop/using-composer/using-drupals-lenient... β†’

πŸ‡«πŸ‡·France arnaud-brugnon

#74 helps a little but it's not enough.
For some unknown reason, i can't have all of my items.

So i found another workaround.
Put migrations in the same group, add an index before id (don't forget to rename tables to keep migration track) and launch import on group.

Btw, #70 have a good point.
By adding some intels to row, we may add reason for ignore.
Because #74 does not do that and it's pretty annoying.

πŸ‡«πŸ‡·France arnaud-brugnon

#23 is problably the closest solution.

Use entity_lookup plugin is probably the best solution (nid_to_update is problably the uggliest solution)

One precision to make entity_lookup works like a charm : Don't miss one import key (otherwise entity lookup will fail).
It means you will have to set entity_type, bundle, bundle_key and value_key.
bundle_key may seems overkill but you have to define it.

Full migration file here

id: tax_classification_import
label: Import tax classifications
migration_group: product_import

source:
  plugin: import_tax_classification
  data_fetcher_plugin: http
  data_parser_plugin: json
  verify: FALSE
  fields:
    - name: code
      label: 'Code'
      selector: productTaxClassification/code
    - name: taxRate
      label: 'Tax rate'
      selector: tax/taxRate
  ids:
    code:
      type: string
  request_options:
    verify: false

process:
  tid:
    plugin: entity_lookup
    source: code
    entity_type: taxonomy_term
    bundle: tax_classification
    bundle_key: vid
    value_key: field_code
    ignore_case: true
    access_check: 0
  vid:
    plugin: default_value
    default_value: tax_classification
  name: code
  field_code: code
  status:
    plugin: default_value
    default_value: 1
  field_rate: taxRate

destination:
  plugin: 'entity:taxonomy_term'
  overwrite_properties:
    - field_rate
πŸ‡«πŸ‡·France arnaud-brugnon

#3 works like a charm

A bit annoying warning when we use unit tests.

πŸ‡«πŸ‡·France arnaud-brugnon

Small improvement to have only one patch and pass x-tag in lowercase because varnish refuse to invalidate uppercase x-tag

πŸ‡«πŸ‡·France arnaud-brugnon

Please let me know if you don't want our solution, we will move it in a custom CacheManager and override service injection (to prevent to keep so much change in a patch)

πŸ‡«πŸ‡·France arnaud-brugnon

Here's our full solution

This patch must be install with #5

πŸ‡«πŸ‡·France arnaud-brugnon

Here's some example of compression :

Cache tag : "agency:yvelines:houilles"
Custom compression : 1L2X2N
#8 solution : ikaa11ev

Cache tag : "node:76"
Custom compression : 1c1e
#8 solution : fgrjero9

Cache tag : "node:67"
Custom compression : 1c15
#8 solution : gn4fonhc

Cache tag : "abcd"
Custom compression : K
#8 solution : sbu72j27

Cache tag : "agency:yvelines:andagainoadsglkfghalkefgjkasdfbglkasdbglkabsdlkgjasdfkjgnasdg"
Custom compression : 1L2XgM
#8 solution : se47ecf1

πŸ‡«πŸ‡·France arnaud-brugnon

#8 is a great idea.

But we have a better algorithm that's suppose to prevent any collision.
If it work's, x tag may be a bit longer for some occasion (for complexe cache tags like 'segment1:segment2:segment3:segment4').

But it's not the common case.

For exemple, 'node:76' enconding should on two caracters (if i remember correct).
One letter and on digit.

πŸ‡«πŸ‡·France arnaud-brugnon

What a coΓ―ncidence, i just met the same issue.

My collegue and i are working a better solution but it s not easy.
We can't just increase hash and hoping for the best.
It will decrease duplicate x tag but not enough.

Also, we can't just add a long string for x tag.
X tag, as it s actually made, is really useful to prevent nginx to raise an exception for too big header.

If we can post better cache tags compression, we will do.

πŸ‡«πŸ‡·France arnaud-brugnon

Sure.
I dont not use facets module (i dont like it aha).

But i do use search api module (i dont know if it matters or not)

πŸ‡«πŸ‡·France arnaud-brugnon

I don't think this a duplicate

In my case, ajax pager does not work in media library and i supposed that it's because page is define twice

#12 solve my problem while compress ajax_state does not change anything.

Btw i am using gin theme, but it's claro template so ..

πŸ‡«πŸ‡·France arnaud-brugnon

Damn.
Indeed, it was my mistake.
I closed it.

πŸ‡«πŸ‡·France arnaud-brugnon

Here's my code.
Maybe you will understand better

πŸ‡«πŸ‡·France arnaud-brugnon

Sorry for the delay, i was a bit busy.

I use bundle classes to add specific access to my bundle under some circumtances.

Without my patch, i must return FALSE in ACCESS method to remove it from sitemap.xml

But if i return FALSE, i got this error

Drupal\Core\Access\AccessException: Access error in access_check.entity. Access services must return an object that implements AccessResultInterface. in Drupal\Core\Access\AccessManager->performCheck() (line 163 of core/lib/Drupal/Core/Access/AccessManager.php).

I think it's dumb because access method is suppose to return boolean (as php doc suggest).
But i think it's easier to fix a module core that the core itself.

πŸ‡«πŸ‡·France arnaud-brugnon

#25 is not a good idea.
For some reasons (for my client for example), there is the same label in multiple link contents but some have links and other don't.

With #25, my alias is empty.
But it should not be.

πŸ‡«πŸ‡·France arnaud-brugnon

Here's a patch to solve it

πŸ‡«πŸ‡·France arnaud-brugnon

Awesome
14 years later, this documentation still works like a charm.

Thank you.

πŸ‡«πŸ‡·France arnaud-brugnon

Improve patch based on #160 comments

By the way, it works fine for me.

πŸ‡«πŸ‡·France arnaud-brugnon

Here's a patch to solve this.

But i really think that private should be changed as protected.

πŸ‡«πŸ‡·France arnaud-brugnon

This is quite important.
8.x-1.1 is supposed to be compatible with Drupal 10.

πŸ‡«πŸ‡·France arnaud-brugnon

Works like a charm (even if code quality can be better).

Be aware that if you don't use this patch is 8.2, you may have cache issue.
Because this patch solve a warning.
Warning are display by MessengerService
MessengerService kill cache when you display a message (surprise !)

πŸ‡«πŸ‡·France arnaud-brugnon

#21 works for me in custom form only if we had #tree = TRUE

  /**
   * {@inheritDoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $form['background_image'] = $this->getEntityBrowserForm(
      'paragraphs_library_items', // Entity Browser config entity ID
      $this->configuration['background_image'], // Default value as a string
      1, // Cardinality
      'preview' // The view mode to use when displaying the entity in the selected entities table
    );
    
    // Convert the wrapping container to a details element.
    $form['background_image']['#type'] = 'details';
    $form['background_image']['#title'] = $this->t('Background image');
    $form['background_image']['#open'] = TRUE;
    $form['background_image']['#tree'] = TRUE;
    return $form;
  }
πŸ‡«πŸ‡·France arnaud-brugnon

Great news

https://www.drupal.org/node/3180429 β†’

hook_field_widget_WIDGET_TYPE_form_alter no longer exist.
Use hook_field_widget_single_element_form_alter instead

Production build 0.71.5 2024