Problem/Motivation

There's functions deprecated for removal in core 10

Proposed resolution

remove the usage, make sure no mentions left

Remaining tasks

review/commit

User interface changes

no

API changes

no

Data model changes

no

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost created an issue. See original summary.

andypost’s picture

andypost’s picture

Assigned: Unassigned » Lendude
Status: Active » Needs review
FileSize
47.18 KB

Needs views maintainer approaval

andypost’s picture

andypost’s picture

FileSize
796 bytes
47.33 KB

fix CS

andypost’s picture

Status: Needs review » Needs work

The last submitted patch, 5: 3261245-5.patch, failed testing. View results

andypost’s picture

Status: Needs work » Needs review
FileSize
880 bytes
48.19 KB

No idea where to point TODO but this function now no-op

Edit the issues should be kinda #3106666: Remove post updates added prior to 8.8.0

Status: Needs review » Needs work

The last submitted patch, 8: 3261245-8.patch, failed testing. View results

andypost’s picture

andypost’s picture

Title: Remove deprecated views.module functions » Remove deprecated views module functions
catch’s picture

Title: Remove deprecated views module functions » [PP-1] Remove deprecated views module functions
andypost’s picture

Title: [PP-1] Remove deprecated views module functions » Remove deprecated views module functions
andypost’s picture

Related issues: +#3261251: Remove deprecated node module functions
FileSize
47.33 KB
andypost’s picture

Status: Needs work » Needs review
FileSize
1.62 KB
48.95 KB

the plugin already removed from node module via https://www.drupal.org/node/2857891

I think the changes needs separate issue to remove remains on removed plugin, as there's extensive testing in core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_test_link.yml

quietone’s picture

Status: Needs review » Needs work

Found another one.

$ grep -r "@trigger" core | grep -v "node_modules" | grep -v views_ui | grep -i views
core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php:      @trigger_error($this->definition['deprecated'], E_USER_DEPRECATED);
core/modules/file/src/Plugin/views/field/File.php:      @trigger_error('Calling File::__construct() without the $file_url_generator argument is deprecated in drupal:9.3.0 and the $file_url_generator argument will be required in drupal:10.0.0. See https://www.drupal.org/node/2940031', E_USER_DEPRECATED);
longwave’s picture

Status: Needs work » Needs review
FileSize
50.33 KB
1.38 KB

Status: Needs review » Needs work

The last submitted patch, 17: 3261245-17.patch, failed testing. View results

longwave’s picture

Status: Needs work » Needs review

Unrelated fail in QuickEditFileTest.

catch’s picture

Status: Needs review » Needs work
+++ /dev/null
@@ -1,143 +0,0 @@
-
-  /**
-   * Loads a test view.
-   *
-   * @param string $view_id
-   *   The view config ID.
-   *
-   * @return \Drupal\views\ViewEntityInterface
-   *   A view entity object.
-   */
-  protected function loadTestView($view_id) {
-    // We just instantiate the test view from the raw configuration, as it may
-    // not be possible to save it, due to its faulty schema.
-    $config_dir = $this->getModulePath('views') . '/tests/fixtures/update';
-    $file_storage = new FileStorage($config_dir);
-    $values = $file_storage->read($view_id);
-    /** @var \Drupal\views\ViewEntityInterface $test_view */
-    $test_view = $this->container
-      ->get('entity_type.manager')
-      ->getStorage('view')
-      ->create($values);
-    return $test_view;
-  }
-

I think we should probably keep this in core with no tests methods, so it can be used for the next views update. There may already be one in 10.x since the patch was created.

andregp’s picture

Status: Needs work » Needs review
FileSize
52.44 KB
7.74 KB

Bringing back ViewsConfigUpdaterTest::loadTestView as @catch suggested.

Obs.: The diff is a bit off because I had to do a small reroll (as views.view.test_user_multi_value.yml and ViewsConfigUpdaterTest.php had some alterations (commits) since last patch).

andregp’s picture

Sorry, I didn't pay attention to the PHPStan check and missed an error.

use ($view) was removed from ViewsConfigUpdater::updateAll since it wasn't being used, but the following line was added to updateAll on commit 9f17ffb15e (Issue #3173180).

      if ($this->processImageLazyLoadFieldHandler($handler, $handler_type, $view)) {
        $changed = TRUE;
      }

So I added back use ($view) to the method caller.

Status: Needs review » Needs work

The last submitted patch, 22: 3261245-22.patch, failed testing. View results

andregp’s picture

Status: Needs work » Needs review

The only fail on patch #22 is:

1) Warning
No tests found in class "Drupal\Tests\views\Kernel\ViewsConfigUpdaterTest".

Which was expected since @catch asked to "keep this in core with no tests methods" (#20) so sending back to NR.

paulocs’s picture

Assigned: Lendude » Unassigned
Status: Needs review » Needs work

Should a new Trait be created with the loadTestView function in this case?

catch’s picture

Maybe we could keep a stub test method with ::markTestSkipped() or a dummy assertion - the main reason to leave this in is because I am pretty sure we will need it again within weeks or at the most months.

paulocs’s picture

Status: Needs work » Needs review
FileSize
52.52 KB
639 bytes

Addressed #26.
Please review.

paulocs’s picture

Ops. I forgot to add 'test' before the function name.

The last submitted patch, 27: 3261245-27.patch, failed testing. View results

daffie’s picture

  1. We are keeping the class ViewsConfigUpdate, therefor the following comment needs to be changed:
     *   This class is only meant to fix outdated views configuration and its
     *   methods should not be invoked directly. It will be removed once all the
     *   deprecated methods have been removed.
     */
    class ViewsConfigUpdater implements ContainerInjectionInterface {
    
  2. We are removing the plugin node_path, only it is still used in modules/views/tests/modules/views_test_config/test_views/views.view.test_destroy.yml:
    path:
      field: path
      id: path
      table: node
      plugin_id: node_path
      entity_type: node
    
  3. +++ b/core/modules/views/src/ViewsConfigUpdater.php
    @@ -189,300 +176,6 @@ protected function processDisplayHandlers(ViewEntityInterface $view, $return_on_
    -      @trigger_error(sprintf('The entity link url update for the "%s" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2857891.', $view->id()), E_USER_DEPRECATED);
    

    We are removing this deprecation warning. Can the suppression of this warning be removed from tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php?

  4. +++ b/core/modules/views/src/ViewsConfigUpdater.php
    @@ -189,300 +176,6 @@ protected function processDisplayHandlers(ViewEntityInterface $view, $return_on_
    -      @trigger_error(sprintf('The operator defaults update for the "%s" view is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Module-provided Views configuration should be updated to accommodate the changes described at https://www.drupal.org/node/2869168.', $view->id()), E_USER_DEPRECATED);
    

    The same for this deprecation warning. See previous item.

andregp’s picture

Status: Needs work » Needs review
FileSize
55.35 KB
2.7 KB

A new patch trying to address the points on #30

daffie’s picture

Status: Needs review » Reviewed & tested by the community

All my points have been addressed.
All code changes look good to me.
For me it is RTBC.

  • catch committed 55e559e on 10.0.x
    Issue #3261245 by andypost, andregp, paulocs, longwave, catch, daffie,...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 55e559e and pushed to 10.0.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.