Problem/Motivation

The migration documentation includes a page,
Migrating to Drupal 8 from a previous version, that just redirects to another migration documentation page. The page is only needed because the node number is hard coded in core.

'description' => 'Your system schema version is ' . $system_schema . '. Updating directly from a schema version prior to 8000 is not supported. You must <a href="https://www.drupal.org/node/2179269">migrate your site to Drupal 8</a> first.',

Proposed resolution

1. Replace the hard coded node number in core with a link to Upgrade to Drupal 8.
2. Make a documentation issue to have /node/2179269 hidden from the documentation guide navigation as per the existing text on the page.

The latest screenshot, from #17

Remaining tasks

Documentation issue has been created, see #2914984: Hide node/2179269 from 'Upgrade to Drupal 8' guide
Review the patch.
Commit

User interface changes

Yes

API changes

N/A

Data model changes

N/A

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

quietone created an issue. See original summary.

quietone’s picture

masipila’s picture

Assigned: Unassigned » masipila

I'll write a patch this evening for this.

masipila’s picture

Status: Active » Needs review
FileSize
896 bytes

Here's the simple patch to change the URL in core/includes/update.inc to the correct landing page for the 'Upgrade to Drupal 8' guide.

What comes to removing the old page https://www.drupal.org/node/2179269: I don't think it's necessary to delete that node, we can simply hide it from the guide navigation. That can actually be done already before this patch lands. I'll create a d.o. documentation issue for that.

Cheers,
Markus

masipila’s picture

Title: Removed hard coded reference to node/2179269 » Remove hard coded reference to node/2179269
Issue summary: View changes
masipila’s picture

Assigned: masipila » Unassigned
quietone’s picture

Status: Needs review » Needs work
FileSize
12.59 KB
11.81 KB

Tested this by forcing the schema_version to be 1000. Attached is attached a before and after screenshot. The link has been changed and looks correct. However, in both the href tag is displayed and not the a clickable link. Back to NW for that.

Before:

After:

masipila’s picture

The documentation part has been done and the remaining thing is to fix the link in core.

I removed the parent meta issue from this so that I can close the parent meta about reorganizing the doc guides as that has been now completed.

Cheers,
Markus

quietone’s picture

Status: Needs work » Needs review
FileSize
903 bytes
12.26 KB

How about wrap the text in the t function.

masipila’s picture

Status: Needs review » Needs work

The latest patch is still pointing to the old URL i.e. https://www.drupal.org/node/2179269

That URL is now working because I asked the d.o. team to redirect from there to the current URL https://www.drupal.org/docs/8/upgrade which is technically
https://www.drupal.org/node/2786407

So now that we're fixing the t() issue, let's also point the link directly to the correct URL i.e either https://www.drupal.org/docs/8/upgrade or
https://www.drupal.org/node/2786407

Markus

quietone’s picture

Status: Needs work » Needs review
FileSize
905 bytes
822 bytes

@masipila, thanks. Here is another try.

masipila’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me, RTBC. I guess we need another reviewer though as I was contributing to the patch earlier.

Markus

xjm’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs followup
--- a/core/includes/update.inc
+++ b/core/includes/update.inc

@@ -83,7 +83,7 @@ function update_system_schema_requirements() {
-      'description' => 'Your system schema version is ' . $system_schema . '. Updating directly from a schema version prior to 8000 is not supported. You must <a href="https://www.drupal.org/node/2179269">migrate your site to Drupal 8</a> first.',
+      'description' => t('Your system schema version is ' . $system_schema . '. Updating directly from a schema version prior to 8000 is not supported. You must <a href="https://www.drupal.org/docs/8/upgrade">migrate your site to Drupal 8</a> first.'),

So, adding a t() here is out of scope for correcting a URL in a string.

I also suspect these requirements don't have t() on purpose because they might have been used in early bootstrap when t() was not available.

The specific lines were added in #2168011: Remove all 7.x to 8.x update hooks and disallow updates from the previous major version, but they were based on lines moved from update_prepare_d8_bootstrap(), which in turn was based on update_prepare_d7_bootstrap(). Before that, they were originally added in #864464: Upgrade path broken if not run from at least Drupal 6.16 like seven years ago. And those lines were added alongside existing untranslated strings dating back to #233091: Move code from update.php into includes/update.inc. And so on. Basically, these have been untranslated as long as update.php has been around.

It could be that we can translate these strings now after all the refactoring that's happened in Drupal 8, but if so, we should discuss that in a dedicated issue and add t() in all the places that they're missing in early update requirements, rather than just adding one offhand here. So tagging "Needs followup" to file such an issue.

Meanwhile, let's remove the added t() from this patch to keep the issue within a single scope. (Reference: https://www.drupal.org/core/scope#creep)

Thanks for working on this!

quietone’s picture

Status: Needs work » Needs review
FileSize
896 bytes

@xjm, thanks for the background.

Removing the t() function means we can use the patch in #4. So, re uploading patch 4 here to help the reviewers.

Added the followup, #2918657: add t() in all early update requirements

neerajsingh’s picture

Status: Needs review » Reviewed & tested by the community

I agree to @xjm, here neither l() nor t() functions can be used, as they might be called in early bootstrap.

Patch at #14, looks good to me.

masipila’s picture

Assigned: Unassigned » masipila
Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs followup

If we're not able to produce hyperlinks in the error (see #7), let's then change the message so that we don't have any html in it. Instead, let's change the wording so that it will say like this at the end:

You must migrate your site to Drupal 8 first, see https://www.drupal.org/docs/8/upgrade.

I'll do this today.

Also removing the 'Needs followup' tag as @quietone created the follow-up in #14.

Markus

Edit: clarification on the follow-up tag.

masipila’s picture

Assigned: masipila » Unassigned
Status: Needs work » Needs review
FileSize
887 bytes
889 bytes

Here we go.

quietone’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
FileSize
11.25 KB

Good idea to remove the tags and show something more friendly to the user. I think this is within scope and we have the followup.

quietone’s picture

Issue tags: +DrupalSouth 2017
larowlan’s picture

Adding @xjm for review

  • larowlan committed 37d0cad on 8.5.x
    Issue #2914292 by quietone, masipila, xjm: Remove hard coded reference...

  • larowlan committed 8d2de8f on 8.4.x
    Issue #2914292 by quietone, masipila, xjm: Remove hard coded reference...
larowlan’s picture

Version: 8.5.x-dev » 8.4.x-dev
Status: Reviewed & tested by the community » Fixed

Committed as 37d0cad and pushed to 8.5.x

Cherry-picked as 8d2de8f and pushed to 8.4.x

Status: Fixed » Closed (fixed)

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