hook_help() is broken because it doesn't use routes. hook_help() now uses routes. See https://www.drupal.org/node/2250345

Patch attached. Please provide credit on commit.

CommentFileSizeAuthor
#17 2615592-16-scheduler-hook-help.patch2.92 KBjonathan1055
#15 2615592-15-scheduler-hook-help.patch2.92 KBjonathan1055
#9 scheduler-help-fix-9.patch4.1 KBAnonymous (not verified)
#4 scheduler-help-fix.patch2.65 KBAnonymous (not verified)
scheduler-help-fix.patch2.67 KBAnonymous (not verified)

Comments

Anonymous’s picture

pferlito created an issue. See original summary.

Anonymous’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, scheduler-help-fix.patch, failed testing.

Anonymous’s picture

StatusFileSize
new2.65 KB

Cleaned up patch file.

jonathan1055’s picture

Hi pferlito,
Thanks for noticing this and producing a patch. I'll test it.
Jonathan

jonathan1055’s picture

Status: Needs work » Needs review

Attempt to see if D.O. testing runs now that the test branch is merged into Master.

Status: Needs review » Needs work

The last submitted patch, 4: scheduler-help-fix.patch, failed testing.

jonathan1055’s picture

Title: Help is broken » Convert hook_help to use routes

Tested and it works.

However, did you notice that the link which is generated for the content-type list using Url::fromRoute('entity.node_type.collection') results in /admin/config/content/scheduler when it should be /admin/structure/types. I know this was not your change, and at the time we probably did not have the means to test it. But it needs to be fixed. How do we find out the conversions of Url::fromRoute to url values?

Thanks for getting this going, and making the patch. We always give credit to patch providers so will certainly do so here.

Anonymous’s picture

StatusFileSize
new4.1 KB

Sorry I didn't spot this. I see the problem. fromRoute() returns a URL object. Needs to be converted to a string. New patch attached.

jonathan1055’s picture

Status: Needs work » Needs review
Related issues: +#2594615: Automated testing in 8.x [meta]

Thank you, yes that works. I must learn more about the routes.
Interesting that your file actually contain two separate patches (as I know them) the original intact and your second change separately. Is this another standard way to supply patches?

I've set to 'needs review' just to see if our automated testing copes with this style of patch. I know the tests will fail as we've not completed #2594615: Automated testing in 8.x [meta] yet, but I'd like to see if they at least start.

Status: Needs review » Needs work

The last submitted patch, 9: scheduler-help-fix-9.patch, failed testing.

Anonymous’s picture

No, I think that must have been a mistake on my part in generation. I think I still had the old patch lying around when I did the diff. Sorry about that.

jonathan1055’s picture

Well, looking at the test result log on https://dispatcher.drupalci.org/job/default/45734/console is seems there was no problem in applying the patch file. I can't tell if it applied one or both "patches" as neither of them would affect the current state of the tests, but usually if a patch file is not in a usable format you get a message and the testing process is halted.

There's no need for you to provide a new consolidated patch, I can use what you've given. But before I commit, I'd like my co-maintainer to take a quick review of your code. It all looks OK to me, and certainly the main fault is resolved, and the three parts of the help are now displayed as expected. Thanks for doing this.

jonathan1055’s picture

Actually I've just noticed that in the dblog after applying your patches we get:

Recoverable fatal error: Argument 2 passed to scheduler_help() must be an instance of RouteMatchInterface,
instance of Drupal\Core\Routing\CurrentRouteMatch given in scheduler_help()
(line 53 of /Library/WebServer/Documents/drupal8/modules/scheduler/scheduler.module).

Looking at the example on the change notice on https://www.drupal.org/node/2250345 we need to add

use Drupal\Core\Routing\RouteMatchInterface;

Doing this removes the error.

jonathan1055’s picture

Status: Needs work » Needs review
StatusFileSize
new2.92 KB

Here's a single patch with everything from the above.

Status: Needs review » Needs work

The last submitted patch, 15: 2615592-15-scheduler-hook-help.patch, failed testing.

jonathan1055’s picture

Status: Needs work » Needs review
StatusFileSize
new2.92 KB

Patch needed a re-roll due to other commits. Tested each of the three help outputs - all OK. We do not have tests for this, but I don't think we need any, as it is static functionality and not much can go wrong.

I think this is good to go. Any objections?

Status: Needs review » Needs work

The last submitted patch, 17: 2615592-16-scheduler-hook-help.patch, failed testing.

jonathan1055’s picture

Status: Needs work » Needs review

As expected, did not alter the branch test results.

Anonymous’s picture

@jonathan1055 thanks for your attention to this issue, I have no objections to a commit.

jonathan1055’s picture

Status: Needs review » Fixed

Thank you pferlito for your work on this. Committed and fixed.

You are welcome to take a look at our other issues currently blocking the first 8.x release #2662476: Progress towards 8.x release of Scheduler and your help would be appreciated :-)

Status: Fixed » Closed (fixed)

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

The last submitted patch, 15: 2615592-15-scheduler-hook-help.patch, failed testing.

jonathan1055’s picture

Ignore the failed patch above. It was queued but not run until the 8.x committed codebase passed all tests. That happened with my commit a few minutes ago, and then the untested patches have suddenly come to life and been run. This issue is already fixed and closed.