Jump to content

ProcessPageListerUrls


Martijn Geerts
 Share

Recommended Posts

  • 7 months later...

Hi @Martijn Geerts,

Thanks for this module. I'm wanting to explore using it with a custom module that extends ProcessPageLister but the way the module checks if the page ID supplied to the url() method has the correct process is a stumbling block.

In the module there is this test...

if (strpos('ProcessPageListerPro', $listerPage->process) !== false) return $listerPage;

...which seems like a weird way to check that the process is okay. For instance, a process named 'age' would pass this test. And any process that has a different name yet may still be an instance of ProcessPageLister fails the test.

How about a different test?

$process_module = $this->modules->get($listerPage->process);
if($process_module instanceof ProcessPageLister) return $listerPage;

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...