The FacetsPrettyPathsUrlProcessor class extends UrlProcessorPluginBase in a manner that makes it hard to inherit the class and override some methods.

As a result, a developer who wants to implement custom URL construction rules (like me) is forced to literally copy-paste the whole class.

The patch below addresses some of these issues, splitting monolithic class methods into few smaller ones which I hope should make it easier to maintain and extend.

Comments

abramm created an issue. See original summary.

abramm’s picture

Assigned: abramm » Unassigned
Status: Active » Needs review
StatusFileSize
new14.22 KB

I've also addressed few coding standards issues and replaced some static function calls with services.
I know that's a bit out of scope but I did it since I was moving few chunks of code anyway.

abramm’s picture

StatusFileSize
new15.94 KB

Here's a re-roll for latest dev.

Could someone please review this patch? It does not change any functionality or anything, just makes code more friendly to third-party developers.

Thanks!

borisson_’s picture

This looks solid at first glance. I'm in favor of the idea.

upchuk’s picture

Status: Needs review » Needs work

@abramm would you like to reroll this in a PR on github?

Changes have been committed, it's now also tested.

upchuk’s picture

Please be aware that I also merged #3005452: Active filters logic abstraction which moves the active filters logic to another service.

abramm’s picture

Hi @Upchuk,
Unfortunately I'm not working on any project using facets anymore. I'd be happy to support someone doing a re-roll or any further job on this thought.

upchuk’s picture

Status: Needs work » Closed (won't fix)

Alright, closing then. Thanks.

rollins’s picture

I had the same issue, so I updated patch for 1.0 version of Facets Pretty Paths module.

lukasss’s picture

+ 1 for refactor this plugin class