Problem/Motivation

Drupal\views\EventSubscriber\RouteSubscriber::routeRebuildFinished() is undocumented.

The method's docblock currently consists of a {@inheritdoc} tag, but this method is not declared by any ancestor class.

The method is a callback for the RoutingEvents::ALTER event, declared by the getSubscribedEvents() method in the same class.

Proposed resolution

Replace the {@inheritdoc} tag with an explanation of what the method does.

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andrewmacpherson created an issue. See original summary.

andrewmacpherson’s picture

Issue summary: View changes
Issue tags: +Novice, +php-novice

This will probably be a one-chunk patch, good for a new contributor.

andrewmacpherson’s picture

Issue tags: +SprintWeekend2017
ruloweb’s picture

Assigned: Unassigned » ruloweb

Assigned to me for on of the new contributors in the SprintWeekend2017 Buenos Aires

xjm’s picture

Version: 8.3.x-dev » 8.2.x-dev

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

diaspar’s picture

needs review

tameeshb’s picture

Status: Active » Needs review

You need to Change status to "needs review" after uploading patches for testing them.

ruloweb’s picture

Assigned: ruloweb » Unassigned
andrewmacpherson’s picture

Status: Needs review » Needs work

Thanks for the patch in #7, @diaspar! Here's a review.

Overall, the new docblock follows the right general structure. Looking at the individual lines:

1.

+ * Resets the internal state of the route subscriber and sets Route objects.

This is correct, but it mostly just repeats the code inside the method body. It could be better if it summarized the overall purpose of the method.

Elsewhere in the class, $this->viewRouteNames is described as "an array of route names" rather than objects. The important part of this method is the call to $this->state->set() which stores these newly-generated route names using the State API. The call to $this->reset() is just a bit of clean-up.

Something like "Stores the new route names after they have been rebuilt."

2.

+ * This method is a callback for the RoutingEvents::FINISHED event.

This can be shortened to "Callback for the RoutingEvents::FINISHED event", per the documentation standards for callback implementations.

3.

+ * @see \Drupal\views\EventSubscriber\getSubscribedEvents()

This is a good use of @see, pointing to the where the callback was was registered. However the separator between class name and method name should be a double-colon, like so:

+ * @see \Drupal\views\EventSubscriber::getSubscribedEvents()

A good first patch, @diaspar. If you can make a new patch to address the feedback, I can review it again. Remember to set the issue status back to "Needs Review".

diaspar’s picture

Status: Needs work » Needs review
andrewmacpherson’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @diaspar.

The patch in #12 addresses all the feedback in comment #11.

RTBC - let's pass this on to the committers. Nice first patch!

  • catch committed e7ebae2 on 8.4.x
    Issue #2847655 by diaspar, andrewmacpherson: Document Drupal\views\...

  • catch committed 5242a0b on 8.3.x
    Issue #2847655 by diaspar, andrewmacpherson: Document Drupal\views\...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.4.x and cherry-picked to 8.3.x. Thanks!

Status: Fixed » Closed (fixed)

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