The upgrade page should not have an admin toolbar, sidebars/blocks, etc - like install.php and update.php. I previous looked at doing this and it was harder than you might think - those pages run in a very limited context while we run in a fully-bootstrapped Drupal instance. So, this quite likely will involve patching other parts of core. webchick suggested that the styling of those pages be abstracted for reuse - not sure if this would apply in the very different context we're running in, but certainly worth investigating.

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

Comments

mikeryan’s picture

Version: » 8.x-1.x-dev

Discussed this some with sun (due to his work on #2218039: Render the maintenance/install page like any other HTML page) in IRC, his input:

sun: mikeryan1: hm. It's been a long time. IIRC, we do not have a way to render a page without "the" page in D8 (yet). In D7, we had a lot more spaghetti that made it possible to render only custom fragments of a page, but in D8 everything runs through standardized page rendering pipelines
sun: mikeryan1: The primary challenge is to replace the module list with a hard-coded minimal list, which does not contain page/layout modules like Block module (because as soon as Block module is enabled, its hook_page_build() or w/e will get invoked, and in turn, it will read the blocks to render from the active config)
mikeryan1: sun: We might be able to do the partial bootstrap thing for the form, but when running the migration we need a full bootstrap to write to all the modules
sun: mikeryan1: yeah... tricky. IIRC, my last conclusion was that we'd need a way to operate with two module lists at the same time - one minimal list that is only used for the theme/page rendering pipeline, and another full list that is used for all API calls under the hood (but not theme stuff)
mikeryan1: sun: Could I disable/remove regions in hook_page_alter()?
sun: mikeryan1: You can try Drupal\Core\Page\DefaultHtmlPageRenderer::renderPage()

He didn't respond directly on hook_page_alter(), but that's something I can quickly implement and test so I'll give it a shot before moving on to basically making what should be a simpler version of update.php that uses DefaultHtmlPageRenderer::renderPage().

mikeryan’s picture

Status: Active » Needs work
FileSize
1.18 KB
135.18 KB
42.28 KB

Well, attached is a stab at this which basically works, at least with the standard profile/themes, although it needs some styling (margins, at least). This seems too hacky though (hardwiring based on request_path(), hiding stuff with display:none, ...) - would it be better to continue on this line with less hacking, or do we need to go to the update.php approach of taking over the entire request? I need some help from someone with better D8 front-end skillz...

joelpittet’s picture

mikeryan’s picture

Issue tags: +Barcelona2015

Tagging for Barcelona.

quietone’s picture

If this will be like install and update then shouldn't all upgrade forms be un-themed?

@joelpittet, can you point me to a working example of using template overriders?

joelpittet’s picture

I think I meant template suggestions. Would be just using this hook.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!theme.api....

quietone’s picture

@joelpittet, thanks. I tried that with no success at all. But then I don't know anything about front end work (that's why I tried this issue). Is there a working example for what your suggesting?

quietone’s picture

FileSize
4.63 KB
46.82 KB
34.68 KB

As agreed on IRC with mikeryan here is some work on this. Please note that this is the first time I've done front end work so this could be way off.

I'm not sure if the goal here is to untheme the page, as in the issue title, or to make the page like the install and update pages. In any case, I tried both. The first thing I tried was template overrides and I didn't get that working for this case. So, I looked at how the install and update processes work and copied that.

This patch will display the upgrade form with the same template (maintenance_page) as the update process. The attached screenshots show what that looks like. And, to see the formed 'unthemed' simply change the 'maintenance_page' string to an empty string in MigrateController.php.
return $this->bareHtmlPageRenderer->renderBarePage($output, $title, 'maintenance_page', $regions);

However, even if this is on the right track, the batch pages are still shown using the admin theme.

Oops, uploaded the wrong images, the correct ones are in the next comment.

quietone’s picture

FileSize
46.82 KB
34.68 KB

Somehow managed to upload the wrong images. These should be right.

mikeryan’s picture

Status: Needs work » Closed (duplicate)
Issue tags: -Barcelona2015
Related issues: +#2678638: [META] Usability refinements for Migrate UI

Any further UX refinement should go under #2678638: [META] Usability refinements for Migrate UI.