Comments

thalles created an issue. See original summary.

thalles’s picture

Status: Needs work » Needs review
StatusFileSize
new878 bytes

Follow the patch!

romixua’s picture

Assigned: Unassigned » romixua
Issue tags: +epam-contrib-2019.03
oleksandr yushchenko’s picture

oleksandr yushchenko’s picture

Assigned: oleksandr yushchenko » Unassigned
Status: Needs review » Closed (won't fix)

No need to fix this issue as drupal_get_destination() used in hook_page_build() that can no longer be used.

thalles’s picture

So should we remove the hook?

romixua’s picture

Yes, looks like we need to remove this hook.

Raman Starshykh’s picture

Issue tags: -epam-contrib-2019.03
thalles’s picture

Title: Replace usages of the deprecated drupal_get_destination() function » Remove unused hook_page_build()
Status: Closed (won't fix) » Needs work
thalles’s picture

Status: Needs work » Needs review

Follow the patch by removing the hook!

thalles’s picture

amit.drupal’s picture

Assigned: Unassigned » amit.drupal
amit.drupal’s picture

Assigned: amit.drupal » Unassigned
StatusFileSize
new812 bytes

As per Drupal 8: hook_page_build() is replace with hook_page_attachments() -- see this CR: https://www.drupal.org/node/2357755

It looks like hook_page_attachments() is the right one to go with.

Status: Needs review » Needs work

The last submitted patch, 13: redirect-Remove_unused_hook_page_build-3035665-13-D8.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

oleksandr yushchenko’s picture

Title: Remove unused hook_page_build() » Replace unused hook_page_build()
Issue summary: View changes
oleksandr yushchenko’s picture

Status: Needs work » Needs review
StatusFileSize
new4 KB

Removed unused hook_page_build() and implemented functionality with Route Subscriber

berdir’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Interesting approach, I think we need a test to make sure this functionality works and doesn't break anything.

oleksandr yushchenko’s picture

Status: Needs work » Needs review
StatusFileSize
new6.91 KB

Updated patch with tests.

Status: Needs review » Needs work

The last submitted patch, 18: redirect-Replace_unused_hook_page_build-3035665-18-D8.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

oleksandr yushchenko’s picture

Status: Needs work » Needs review
StatusFileSize
new6.99 KB

Status: Needs review » Needs work

The last submitted patch, 20: redirect-Replace_unused_hook_page_build-3035665-20-D8.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

oleksandr yushchenko’s picture

StatusFileSize
new6.94 KB
oleksandr yushchenko’s picture

StatusFileSize
new7.01 KB
oleksandr yushchenko’s picture

Status: Needs work » Needs review
berdir’s picture

Status: Needs review » Needs work
Issue tags: -Needs tests

I think the problem with this approach is that it only works with the default 404 page. Most people have a custom 404 page with content I think.

Can't we use hook_menu_local_tasks_alter() for this? I've checked that this is called also if there are no local tasks yet, so we should be able to dynamically insert one.

oleksandr yushchenko’s picture

Title: Replace unused hook_page_build() » Remove unused hook_page_build()
Status: Needs work » Needs review
StatusFileSize
new2.05 KB

I have checked and hook_menu_local_tasks_alter() do not called if there are no local tasks yet, so lets only remove unused hook_page_build() (also redirect_is_current_page_404() which was used in hook) in this task and implement an action on 404 pages to create a redirect in new one if needed.

andreyks’s picture

Agree with #26. Hook hook_page_build does not exist in D8/9/10. So these functions can be removed. If this functionality was required, new bugs would be opened.

andreyks’s picture

Reroll patch #26

murz’s picture

Status: Needs review » Reviewed & tested by the community

I've reviewed and retested the last patch form #28 and it works well and successfully redirects on 404 pages to the configured target URL, on Drupal 8.x and 9.x too. So looks good to me and should be ready to commit!

berdir’s picture

Title: Remove unused hook_page_build() » Replace hook_page_build() with working approach to add redirect from 404 page
Status: Reviewed & tested by the community » Needs work

The issue is about finding a suitable replacement for this feature, not just removing the code. It served a purpose, there's little to gain from just removing it.

berdir’s picture

I changed my opinion on this, also due to #3035665: Remove hook_page_build(), it no longer exists. Doesn't look like people are that interested in it, so lets remove it.

It does need a rebase though and should be converted to a MR.

berdir’s picture

Title: Replace hook_page_build() with working approach to add redirect from 404 page » Remove hook_page_build(), it no longer exists

berdir’s picture

Status: Needs review » Fixed

Merged.

Status: Fixed » Closed (fixed)

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