Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#49 | 1946348-49.patch | 12.96 KB | jibran |
#49 | interdiff.txt | 403 bytes | jibran |
#48 | 1946348-48.patch | 13.36 KB | jibran |
#48 | interdiff.txt | 431 bytes | jibran |
#46 | 1946348-46.patch | 13.36 KB | jibran |
Comments
Comment #1
mtiftAnything that's "take something from hook_menu and make a route of it" should get the WSCCI-conversion tag
Comment #2
msmithcti CreditAttribution: msmithcti commentedComment #3
msmithcti CreditAttribution: msmithcti commentedThis patch converts the two instances of confirm_form() into the new FormInterface and adds a route for /comment/{comment}/delete.
Comment #4
msmithcti CreditAttribution: msmithcti commentedComment #5
Crell CreditAttribution: Crell commentedClasses should be "use"d at the top of the file to avoid needing to inline the entire namespace.
It pains me every time I see this, because we can't fix it yet. :-(
Comment #6
msmithcti CreditAttribution: msmithcti commentedThanks for the review, here's an updated patch with ConfirmDeleteMultiple use'd at the top. I think I'd just copied blindly from the change notice. A few lines like that stuck out at me as well, but I guessed this wasn't the time/place to refactor it.
Comment #7
Crell CreditAttribution: Crell commentedThis should be route_name, not "route name". I think the menu system may be hiding the difference, but elsewhere we've been including the _.
I think that's all that's left? (Sorry, I hate it when I don't find things on the first pass.)
Comment #8
msmithcti CreditAttribution: msmithcti commentedNo problem, here's an updated patch that changes route name to route_name. It does seem like a bit of an inconsistency compared to the rest of the keys in hook_menu though.
Comment #9
msmithcti CreditAttribution: msmithcti commentedOh, here's the patch!
Comment #10
Crell CreditAttribution: Crell commentedOK, let's get this in. Thanks, splatio!
Comment #11
alexpottLooks great... we just have a new documentation standard to apply..
Should be {@inheritdoc} see http://drupal.org/coding-standards/docs#inheritdoc
Comment #12
msmithcti CreditAttribution: msmithcti commentedHere's the patch with {@inheritdoc} replacing all Implements... Should still apply cleanly to HEAD.
Comment #13
ParisLiakos CreditAttribution: ParisLiakos commented#12: convert-comment-confirm-form-1946348-12.patch queued for re-testing.
Comment #15
msmithcti CreditAttribution: msmithcti commentedOK, looks like it needed re-rolling after all!
Comment #16
ParisLiakos CreditAttribution: ParisLiakos commentedi believe the patch misses comment.admin.inc function deletions?
also not quite sure how these are equal?
Comment #17
msmithcti CreditAttribution: msmithcti commentedI missed the deletions when re-rolling the patch, should have been obvious from the file sizes!
The route access has changed since the earlier patches, I'm not sure if we should wait for #1947432: Add a generic EntityAccessCheck to replace entity_page_access() or implement our own access check class in the mean time.
Comment #18
ParisLiakos CreditAttribution: ParisLiakos commented#1947432: Add a generic EntityAccessCheck to replace entity_page_access() is in:)
Also:
Should be Cache::invalidateTags() after you add a use statement for \Drupal\Core\Cache\Cache
you should inject plugin.manager.entity and use it instead
instead of db_query, inject the database service:)
should be new RedirectResponse(url('admin/content/comment', array('absolute' => TRUE)))..
Comment #19
kim.pepperAdded entity access permission, injected all the things, etc. as per #18
Comment #20
kim.pepperJust realised this is going to cause issues. Should we make it a service?
Comment #21
ParisLiakos CreditAttribution: ParisLiakos commentedi think doing this
ConfirmDeleteMultiple::create(Drupal::getContainer())
in drupal_get_formwould work.
i am having second thoughts for this.we are in a form so lets use $form_state['redirect'];
sth like
Does it work that way? If yes then it would be perfect:)
Comment #23
kim.pepperI'm not sure I've seen that pattern before. Seeing what the bot says, but I'm also invoking @Crell for some insight into this.
Comment #25
Crell CreditAttribution: Crell commentedThis is ugly, but at this point in the code there isn't really an alternative.
The better approach would be to convert comment_admin() to a controller now as well. Then the controller class's create() method will have the container available, and it can (get this), create the form on the spot and pass it into the constructor, so the controller can just return drupal_get_form($this->confirmDeleteMultipleForm).
(That may not be the best design, but it sounds cool to describe it at least!)
Alternatively, refactor the paths so that comment_admin() isn't fronting for 2 different forms, and we can then wire the forms directly to the appropriate route. What we're doing here with $_POST is an affront to the gods anyway.
Comment #26
kim.pepperOver at #1978904: Convert comment_admin() to a Controller we are converting the comment_admin to a controller. It seems to be blocked on this issue.
However, I think this issue should wait until that issue is in. We can move out the crappy $_POST stuff over there.
Comment #26.0
kim.pepperLinked to blocking issue
Comment #27
kim.pepperAfter discussion with @tim.plunkett in IRC, we've agreed to convert the admin/comments page to a view with bulk operations #1986606: Convert the comments administration screen to a view, which should help (or remove the need for) this issue.
Comment #28
pcambraAfter discussing with @dawehner, we need to do the fallback conversion of comment_admin in #1986606: Convert the comments administration screen to a view, marking this one as dupe
Comment #29
tim.plunkettThis is still needed for comment_confirm_delete_page().
Comment #30
David Hernández CreditAttribution: David Hernández commentedRe-roll and now I'm trying to convert comment_confirm_delete_page
Comment #31
David Hernández CreditAttribution: David Hernández commentedOops, forgot the patch.
Comment #32
David Hernández CreditAttribution: David Hernández commentedupdated status, to see the test results.
Comment #34
tim.plunkettModernized this a bit.
Comment #35
Crell CreditAttribution: Crell commentedIs there anything relating to an entity that hasn't been generalized? :-)
Comment #36
star-szrNeeds a reroll…
Also, newline at EOF needed I think.
Comment #37
jibranReroll and minor cleanup.
Comment #38
Crell CreditAttribution: Crell commentedAnd back.
Comment #39
alexpottLet's use $this->t from FormBase
Comment #40
jibranFixed #39.
Comment #41
kim.pepper#40: 1946348-40.patch queued for re-testing.
Comment #43
jibranReroll once more.
Comment #45
tim.plunkettThis was already added in another issue.
'/comment
Comment #46
jibranFixed #45.
Comment #47
tim.plunkettWhere is the local task going?
Comment #48
jibranFixed.
Comment #49
jibranReverted unwanted change in
EntityNGConfirmFormBase
.Comment #50
tim.plunkettLooks good to me, thanks!
Comment #51
webchickCommitted and pushed to 8.x. Thanks!
Comment #52.0
(not verified) CreditAttribution: commentedAdded link to 1986606