Closed (fixed)
Project:
Scheduler
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Feb 2015 at 11:33 UTC
Updated:
22 May 2015 at 11:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Palashvijay4O commentedReplaced all the instances! Please review.
Comment #2
jonathan1055 commentedNice work. But may I suggest the variable name
$markupis confusing (a) because it does not say what it contains, and (b) because it is reused again with different contents. Also you have concatenated to it second time, but that does not look the correct thing to do, as it may give the wrong result forif (count($rows) && $markup)But thanks for starting this. It's easy to fix the above.
Jonathan
Comment #3
jonathan1055 commentedComment #4
Palashvijay4O commentedPlease Suggest the changes if you have some good variable names :). Thanks.
Comment #5
pfrenssenThanks for working on this!
A few suggestions:
This is missing the line
'#theme' => 'scheduler_timecheck'.This is not entirely correct,
drupal_render()does not return a render array, but it does accept a render array as an argument.I would simply replace it like this:
return drupal_render($scheduler_timecheck);It doesn't seem needed to concatenate the string.
Comment #6
Palashvijay4O commentedThanks for pointing out the mistakes . Done with the changes please review.
Comment #7
kalinchernev commentedComment #8
kalinchernev commentedGood progress in overall. Few remarks I would add:
Honestly, I'm not sure this is the correct way to prepare the render array here.
Look at the definition from the hook_theme implementation:
I think the 'now' element should actually be prepared in 'arguments' property?
Looks better after implementing the feedback.
However, the'username' theme type is part of D7: https://api.drupal.org/api/drupal/includes!theme.inc/function/theme_user..., but I can't find the same mapping in Drupal 8. I think the closest you can take is 'user' from the list https://api.drupal.org/api/drupal/core%21modules%21system%21theme.api.ph...
Theferore, I would double-check this implementation.
This seems a correct implementation. It might be possible to optimize 1 step forward placing the $pager contents directly inside the drupal_render(). 1 variable less in memory initialization
Also, by the way, it seems that drupal_render() is another function which is going to be deprecated very soon in favor of an OOP method. Look at this one: https://api.drupal.org/api/drupal/core!includes!common.inc/function/drup...
Wouldn't it be a good try to jump on this approach directly?
PS: Latest #6 patch is visible in the list now. The rest are older versions which we could hide to avoid confusion.
Comment #9
kalinchernev commentedComment #10
ieguskiza commentedComment #11
pfrenssenNeeds to be rerolled.
Comment #13
pfrenssenComment #14
pfrenssenThere were only two instances left, and the original patch was outdated since drupal_render() has been deprecated in the meanwhile. Did a new conversion from scratch.
Committed to 8.x-1.x, thanks all!