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.
I have a D6 install that throws PHP notices whenever I disable JavaScript and use any batch API process. The problem is that _batch_progress_page_nojs() uses theme('maintenance_page') but does not call drupal_maintenance_theme() right before, which all other normal calls to that theme function do.
Comment | File | Size | Author |
---|---|---|---|
#13 | 867722-batch-nojs-theme-maintenance-D6-2.patch | 10.23 KB | Dave Reid |
#10 | drupal-DRUPAL-6.batch-no-js.10.patch | 744 bytes | sun |
#1 | 867722-batch-nojs-theme-maintenance-D6.patch | 679 bytes | Dave Reid |
Comments
Comment #1
Dave ReidSimple one-line addition to prevent a slog of PHP notices.
Comment #2
Dave ReidSame does not exist for D7 due to theme improvements by JohnAlbin and co.
Comment #3
sunI'd like to see a reference and/or explanation for those theme improvements, as I'm unable to see where D7 gets this right(er).
Comment #4
Dave ReidIt was fixed by moving template_preprocess_maintenance_page into theme.inc where it was available to call. D7 issue for reference: #321828: maintenance_page not registered correctly in drupal_common_theme()
Comment #5
sunThanks! That explanation makes this patch automatically RTBC.
Comment #6
Dave ReidTagging my modules that are currently affected by this.
Comment #7
Gábor HojtsyThanks, committed.
Comment #8
Gábor HojtsyThis now enforces the maintenance theme to all batches in Drupal 6. That was not the case before. Any theme could have a maintenance page themed, so we should not necessarily set to use the maintenance theme here. Imagine a site having a front end batch process. With this patch and the front end theme not set to be also used as maintenance theme (pretty common I'd say), batches not broken and use Minelli. I'm considering this a regression.
Comment #9
Dave ReidOk then the other solution is to move theme_maintenance_page into includes/theme.inc. I'm not sure if there are any other hidden repercussions for doing that.
Comment #10
sunnah, that means we only want to do what the wrapper function drupal_maintenance_theme() does, but not its innards.
Comment #11
Dave ReidFor some reason I thought I tried the above but it didn't work. I'll re-test.
Comment #12
Dave ReidNope, it doesn't work. Still creates a bunch of notices.
Comment #13
Dave ReidAs I suspected, moving the preprocess function to theme.inc fixes the messages and will allow non-admin themes to be used for batches.
Comment #14
Gábor HojtsyHum, how including the file is different to moving the function to a file already included?
Comment #15
sunI suspect the theme registry doesn't recognize the preprocess function in the not included file when the theme registry is rebuilt, so regardless of whether the preprocess function is callable, the theme system does not know of it, and thus, doesn't try to invoke it.
Comment #17
dpearcefl CreditAttribution: dpearcefl commentedif this patch is still needed, please resubmit the patch with fixes.
Comment #18
sun@dpearceMN: Please stop doing this.
Comment #19
dpearcefl CreditAttribution: dpearcefl commentedI'm just trying to gauge the interest in some issues. if a patch has been submitted and no action was taken to fix t he patch so it would be accepted, then the issue might be considered of little interest.
Comment #20
Dave ReidNot true, so stop doing it.