Account created on 22 October 2012, about 12 years ago
#

Recent comments

🇻🇳Vietnam chuyenlv

@martybfly

The module has a composer.json file and your main composer.lock file is already locked

"require": {
    "drupal/core": "^8 || ^9
} 

You can try https://github.com/mglaman/composer-drupal-lenient to fully upgrade your project to D10.

🇻🇳Vietnam chuyenlv

Hi @seanB
My patch is remove viewsreference parameter from request before added it to $view->element['#viewsreference']
The viewsreference_views_pre_view function will look like:

/**
 * Implements hook_views_pre_view().
 */
function viewsreference_views_pre_view(ViewExecutable $view, $display_id, array &$args) {
  if (!isset($view->element['#viewsreference']) && empty($view->getRequest()->query->all('viewsreference'))) {
    return;
  }

  if (!empty($view->getRequest()->query->all('viewsreference'))) {
    $view->element['#viewsreference'] = $view->getRequest()->query->all('viewsreference');
    $view->getRequest()->query->remove('viewsreference');
    // For ajax views we reset all handlers and make the view initialize again
    // to allow changes from the settings plugins.
    $view->display_handler->handlers = [];
    $view->inited = FALSE;
  }

  // Let all settings plugins alter the view.
  $viewsreference_plugin_manager = \Drupal::service('plugin.manager.viewsreference.setting');
  $plugin_definitions = $viewsreference_plugin_manager->getDefinitions();
  if (isset($view->element['#viewsreference']['enabled_settings'])) {
    foreach ($view->element['#viewsreference']['enabled_settings'] as $enabled_setting) {
      if (!empty($plugin_definitions[$enabled_setting])) {
        $plugin_definition = $plugin_definitions[$enabled_setting];
        /** @var \Drupal\viewsreference\Plugin\ViewsReferenceSettingInterface $plugin_instance */
        $plugin_instance = $viewsreference_plugin_manager->createInstance($plugin_definition['id']);
        $value = $view->element['#viewsreference']['data'][$plugin_definition['id']] ?? $plugin_definition['default_value'];
        $plugin_instance->alterView($view, $value);
      }
    }
  }
}

I verified the viewsreference parameter still exists on the URL of views Ajax.

🇻🇳Vietnam chuyenlv

I had a similar issue with the views enabled views_ajax_history module.

The path for the views_ajax_history module to exclude query parameters from the pager is not good, because we have to update all the views enabled views Ajax history.

So I created a patch to remove viewsreference parameter from request.

🇻🇳Vietnam chuyenlv

Re-roll #121 for 6.0.x, Drupal 10 and PHP 8.1

🇻🇳Vietnam chuyenlv

Updated patch at #6 to compatibility with Drupal 10.1.x and group version 8.x-1.6

🇻🇳Vietnam chuyenlv

Here is simple patch fixed this issue

🇻🇳Vietnam chuyenlv

Tested with Drupal 10 and I see some errors:
- Deprecated function: Creation of dynamic property Drupal\tablefield\Plugin\Field\FieldFormatter\TablefieldFormatter::$ModuleHandler is deprecated
- Deprecated function: Creation of dynamic property Drupal\tablefield\TableValue::$value is deprecated
I create the patch to fix these errors.

Production build 0.71.5 2024