Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
batch system
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
7 Jun 2014 at 16:53 UTC
Updated:
18 Sep 2017 at 17:53 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #1
pushpinderchauhan commentedComment #2
pushpinderchauhan commentedMike, What title we need to show here, please elaborate little bit more.
Comment #3
mikeryant('Running migrations') - it's actually set in the batch array, the reason this is a bug report rather than a task is for some reason the page title while the migration is running shows up as "Site-Install" (in my standard profile install of D8). I'm looking for someone to figure out why the title isn't showing as expected.
Thanks.
Comment #4
hussainwebThe problem seems to be in Drupal core. I was able to reproduce this for Cancel User batch operation. To reproduce:
* Create a test user.
* Go to People listing page, select the checkbox for the test user and in 'With selection' dropdown, select 'Cancel the selected user account(s)'.
* This step may not matter but just in case, select 'Delete the account and its content.' on the next page and 'Cancel accounts'.
* Observe on the next page with the scrollbar that there is no title, even though the code sets it to
t('Cancelling account').Apply the patch and repeat the steps above. The title now appears. This also fixes the original issue with the Migrate Upgrade module.
Comment #5
mikeryanThat looks great, nice and simple. Just one thing - the core tests have been passing with this issue present, so we should have a test to demonstrate that failure, can you add one?
Thanks.
Comment #6
hussainwebTests have been my weakness, but I completely agree - we need one. I will see if I can do it today, otherwise, it will be over the weekend.
Comment #7
karolus commentedJust ran this test--the patch applied cleanly, and looks like a good UX improvement...
Comment #8
joachim commentedThis is a very rough stab at adding testing of this, not tried it out yet -- let's see what the testbot says.
- I'm not sure where best to put it. The batch tests seem a little messy. The PageTest class describes itself as testing the batch page, but then its actual test method is about testing the theme.
- I've no idea whether the test can actually 'see' the batch page long enough for us to run an assertion on it.
Comment #9
mikeryanThe issue status needs to be "Needs review" for the test bot to go at it. But, first, please submit a test-only patch without the fix - we need to test the test to be sure it fails without the fix.
Thanks.
Comment #10
joachim commentedIt's probably going to fail without the fix too... let's just check that.
Comment #12
hussainwebAfter a long long analysis, I think I got the test running. I have attached both a test only patch (which should fail) and then the complete patch.
The challenge in writing the test was, as already pointed out, that the test can't capture the progress page where the title is shown. Other methods use
batch_test_stackto store state information and that is checked later. I planned on doing the same thing but there was no way to find the title.drupal_get_titleis deprecated and the snippet shown instead of drupal_get_title did not work. The only way I could get the title in the test was by using_batch_current_set. If we use that, we are not testing the right thing here.Instead, I set about fixing why the title resolver didn't work. I made the changes in the patch. There is a call to the title resolver in code (which means the fix in #4 would be unnecessary) but that line would never get called due to the if condition. We should probably fix/remove that in a different issue.
Comment #15
dawehnerAre you sure you need both of them?
Comment #16
hussainweb@dawehner: Actually, we don't. I started with the PHP code and then when I started writing the test, I realized that I would have to use _title_callback to get it to work. I left in the PHP code as it wouldn't really do any harm (probably just a slight chance of confusion). Do you think we should remove it?
Comment #17
dawehnerIf it is not needed drop it, there is one less potential source of a bug.
Did you checked whether you can remove the _title_callback from the json route? This route should not have a title as it is never rendered as html.
Comment #18
hussainwebI have dropped that line as per #17 and also removed _title_callback from json route. The tests only patch is still the same.
Comment #22
hussainwebI am just reverting one of the changes removed in #18 to see if that is the reason for the test failure.
Comment #23
hussainwebThis is quite strange. I wonder why the _title_callback on JSON path would affect the regular path. I think this needs more debugging, and might be a flag on a bigger bug.
Comment #24
jhedstromRe #23 I don't understand. In the failing test in #18, both ways of setting the page title were removed, rather than just one:
In #22 one was added back and the tests pass again. Am I missing something?
Comment #27
anavarreComment #28
hussainwebDoing a reroll first.
Comment #29
hussainweb@jhedstrom: See #15. I removed changes from the JSON route and it failed but it worked when I added it back. Like I said in #23, it was rather strange and indicative of some other bug.
Since it is 4 months, I will try removing it again to see if it still fails after the reroll passes.
Comment #31
hussainwebFixing the failure.
Comment #32
hussainwebTrying out by reverting the change I reverted in #22. This removes the
_title_callbackfrom the JSON route (which should not be necessary). This made the tests pass earlier but that was 4 months back. Let's see if this was fixed.Comment #33
hussainwebIt seems that something has changed to fix the bug that we saw in #18. I think the concern in #15 has been addressed.
Comment #34
hussainwebAdding the beta evaluation. I don't think there is anything else left here except review.
Comment #35
joelpittetI tried this with testing UI page, which is still not showing the title.
Comment #36
hussainweb@joelpittet: Can you describe how you tested this? I tested this by canceling few users and checking for title, and the title was there (as seen in attached). This was not present when run without patch.
Can you give a link to testing ui page so that I can check it there too?
Comment #37
joelpittetThe patch does fix that page, so nice work!
I think my issue is an older and different one but there was a title above and below the progress bar that used to update. Right now the below description is showing but the title above doesn't show up anymore.
I was just running any test. Enable testing module (simpletest) and http://d8.dev/admin/config/development/testing
and enable any test to run.
I was hoping this issue would fix that too.
Comment #38
hussainwebI see it there too. This was run on simplytest.me but I don't think that should make any difference.
Comment #39
RavindraSingh commentedApplied the patch #32 still no luck .
Followed these steps to test before and after applying patch:
The problem seems to be in Drupal core. I was able to reproduce this for Cancel User batch operation. To reproduce:
* Create a test user.
* Go to People listing page, select the checkbox for the test user and in 'With selection' dropdown, select 'Cancel the selected user account(s)'.
* This step may not matter but just in case, select 'Delete the account and its content.' on the next page and 'Cancel accounts'.
* Observe on the next page with the scrollbar that there is no title, even though the code sets it to t('Cancelling account').
Apply the patch and repeat the steps above. The title still not appears
Attached is the screenshot
Comment #40
RavindraSingh commentedPlease try on fresh installation of 8.0.x
Comment #41
hussainwebThis means it works, right? I don't understand why you marked it as Needs work. Am I missing something?
Comment #42
RavindraSingh commentedApplied the patch but its not working as you have mentioned. Maybe I missed something. Lets wait community response if this works perfactly.
Comment #43
hussainweb@RavindraSingh: I am not sure if I follow. You said and took screenshot that the title does not appear on batch page. After applying the patch, the title appears (like you confirmed in #39). That is what is supposed to happen with the patch. That is the bug we are fixing here.
Comment #44
RavindraSingh commentedUff, updated the line. seems I did some mistake in writing. As attached screenshot on #39 doesn't show the title with counts.
Comment #45
jhedstrom@hussainweb could you attach the test as a separate patch to illustrate the current breakage? Also, if folks aren't seeing the fix in manual testing, I wonder if the new test is testing the proper behavior?
Comment #46
joelpittet@jhedstrom I did see the fix in manual testing of the user delete batch. I've got a different issue that I should file once I can confirm it wasn't changed on purpose for the batch in the simple test UI.
Comment #47
hussainweb@jhedstrom: I am attaching the same patch as #32 and the tests only version of the patch. This should be very similar to the tests only patch in #12 as the tests haven't really changed.
#44, I didn't realize you meant that the title still didn't appear. I tested the exact same thing on simplytest.me and it worked as expected. See the screenshots below for two different batch pages (one of which is the delete user page). I too had selected 'Delete the account and it's content' option.
@joelpittet, do you mean to say you still don't see the title on any of the batch pages? I thought the above screenshot was what you wanted.
Comment #48
joelpittet@hussainweb different title, it used to live in between the breadcrumbs and the progress bar and it was bold and black title for the batch not the title of the page.
Comment #49
hussainwebOh, okay. It does sound like a different issue then. However, it might be related to this. What should the text be on the tests ui page, for instance? I can do a quick check.
Comment #51
hussainwebAs expected, the tests only patch failed with just the failure we were expecting.
Comment #52
hussainwebThis should still be Needs review.
Comment #53
joelpittetI can't find when it was introduced and or if it was reverted/broken though it's been a while...
I did find something to help me not look completely bonkers.
The Seven style guide has what it is/was supposed to look like.
https://groups.drupal.org/node/283223#Progress
Tried a couple alphas and betas but to no avail.
Comment #54
hussainwebGood find! I will see if I can dig up something about that. It might be a follow up?
Comment #55
hussainwebThis is how it looks on Drupal 7.
Maybe the design shown in style guide is not implemented yet? That makes it a task and not a bug report (which this is). I think this means we need to work this one out in a followup issue.
Comment #56
joelpittetCouple of comment fixes here and I think this is good to ship. Thanks for working on this @hussainweb
Yeah my thing is unrelated to this issue, sorry for the divergence.
I think this comment is a duplicate/incorrect.
This isn't testing the 'theme' it's testing the 'title'?
Comment #57
joelpittetComment #58
hussainwebFixing comments as per #56.
Comment #59
RavindraSingh commentedits working as expected. moving this to RTBC.
Comment #60
alexpottCommitted bce75ca and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.
Comment #63
eelkeblokThis issue seems to have returned (I can't actually remember ever having seen a title when enabling a module). See #2744663: Batch missing title on screen.