Problem/Motivation
If a base theme attempts to hide itself to end users by adding hidden = TRUE
to its .info file, a "Notice: Undefined index" warning is shown while viewing the available updates tab at /admin/reports/updates.
Steps to reproduce the problem:
- Install Drupal 8.x with the standard profile.
- Copy the update module's existing tests themes (core/modules/update/tests/themes/update_test_basetheme and core/modules/update/tests/themes/update_test_subtheme) to /themes (so they become manually testable).
- Edit line 4 of both update_test_basetheme and update_test_subtheme theme's .info file to read
hidden = FALSE
- Add a new line to both update_test_basetheme and update_test_subtheme theme's .info file to read
"project = test"
(required by update module) - Clear cache
- Visit: Appearance (admin/appearance)
- "Enable and set a default" the "Update test subtheme" theme.
- Visit: /admin/reports/updates
- NOTE: no bug
- Edit line 4 of the update_test_basetheme base theme's .info file to read
hidden = TRUE
- Visit: /admin/reports/updates
- NOTE: Notice: Undefined index: update_test_basetheme in theme_update_report() (line 202 of core/modules/update/update.report.inc).
- Apply latest patch: #986888-54: Undefined index warning in "Available Updates List" with hidden=TRUE base themes
- NOTE: Warning is removed
Proposed resolution
The proposed solution and patch addresses this issue by, "...moving a !$file->status if statement lower down to allow building a list of enabled sub themes in more cases (i.e., always)." #986888-12: Undefined index warning in "Available Updates List" with hidden=TRUE base themes
Current workarounds for people who cannot use the patch are to avoid use of hidden = TRUE
of the base theme in use.
Remaining tasks
- "...[fix] this first in 8.x and then in 7.x." #986888-42: Undefined index warning in "Available Updates List" with hidden=TRUE base themes
User interface changes
New features/functionality in the enabled themes (/admin/appearance) user interface, would allow sub themes's base theme to be hidden. Currently, basethemes must be remain visible to avoid "Notice: Undefined index" warnings.
Original report by glisteningC
Notice: Undefined index: adaptivetheme in theme_update_report() (line 201 of /usr/... /drupal7/modules/update/update.report.inc).
This error message (above) shows up when viewing the Available Updates List (tab).
Reports >> Available Updates >> List (tab) or
Home » Administration » Reports >> Available updates >> List
As far as I've seen, it only shows up when viewing the List 'tab'.
It shows up on two different Drupal installations.
Running Drupal 7.0-rc1.
Comment | File | Size | Author |
---|---|---|---|
#85 | 986888-85-availale-updates-d7.patch | 5.12 KB | jday |
#61 | 986888-61-available-updates-list-tests-only.patch | 1.38 KB | dcam |
#61 | 986888-61-available-updates-list.patch | 5.06 KB | dcam |
#54 | 986888-54-tests.patch | 1.52 KB | bdone |
#54 | 986888-54-complete.patch | 5.25 KB | bdone |
Comments
Comment #1
glisteningC CreditAttribution: glisteningC commentedThought this Issue Title is better than the first one I used.
Comment #2
Jeff Burnz CreditAttribution: Jeff Burnz commentedHmmm, looks like it could be a bug in Drupal - I tracked it down to
hidden = TRUE
, which I'm using inadaptivetheme.info
to hide the base theme from end users (such as on the Appearance page). We're meant to be able to use this in Themes in Drupal 7, see http://drupal.org/node/542202 which states this can be used for themes (maybe not base themes?).I'm moving this to the update module queue to get some feedback.
Comment #3
Abilnet CreditAttribution: Abilnet commentedHaving the same error (notice) with 7.0 release:
Notice: Undefined index: adaptivetheme in theme_update_report() (line 201 of /home/XXX/XXX/XXX/modules/update/update.report.inc).
Comment #4
Jeff Burnz CreditAttribution: Jeff Burnz commentedI have removed the hidden = TRUE flag from the info file and has been committed to CVS, I'll be releasing an updated version of the theme very soon, just trying to sort out the skinr module stuff which is holding up a release.
Comment #5
bfroehle CreditAttribution: bfroehle commentedSince it's a relatively simple change, the attached patch changes
_update_process_info_list()
to process hidden themes which have enabled sub-themes. This eliminates the warning shown in this issue, and seems like a reasonable idea to me.Comment #6
olamaekle CreditAttribution: olamaekle commentedGot this message for Zen to.
Comment #7
drbeaker CreditAttribution: drbeaker commentedThis moves the problem to
Notice: Undefined index: adaptivetheme in theme_update_report()
line 201 of modules/update/update.report.inc
Comment #8
bfroehle CreditAttribution: bfroehle commenteddrbeaker:
I think you'll need to manually check for updates once for this to take effect -- (I think it's relying on insufficient cached data). Go to Reports >> Available Updates >> Updates (it's the tab in the upper-right) >> Check manually.
Please report the results.
Comment #9
himerus CreditAttribution: himerus commentedGetting this with Omega as well.
Comment #10
himerus CreditAttribution: himerus commentedSorry, meant to also say that patch seems to work cleanly. No longer getting the notice error.
Comment #11
bfroehle CreditAttribution: bfroehle commenteddrbeaker: The fact that you are still getting the error is because the cached data in {cache_update} is stale. You'll need to empty that table, say via
TRUNCATE TABLE `cache_update`
in SQL.Okay, I do see how you could still get that undefined index error --- we don't properly build
$file->enabled_sub_themes
(inupdate.compare.inc
) in the case where the theme is both enabled and hidden. It seems unlikely, but is certainly possible if first you enable the theme and a later update sets hidden = TRUE.Comment #12
bfroehle CreditAttribution: bfroehle commenteddrbeaker: This should fix your issue in #7.
Attached patch addresses the note in #11. The main change is moving a
!$file->status
if statement lower down to allow building a list of enabled subthemes in more cases (i.e., always).This might still need some more work, as the list of includes / depends / required by might be impacted by this.
Comment #14
bfroehle CreditAttribution: bfroehle commentedReuploading to preserve the random testbot fail in #12.
Comment #15
bfroehle CreditAttribution: bfroehle commentedHas anybody had a chance to test this one out?
Comment #16
davydog CreditAttribution: davydog commentedHi All,
I got a similar error message running the update script on a Drupal 7.0 instance.
Ran updates:
http://(my site).com/#overlay=admin/reports/updates
Got error message:
Notice: Undefined index: boron in theme_update_report() (line 201 of [path from root]/modules/update/update.report.inc).
Took a look at the 'update.report.inc' but can't see what might be triggering the error. Not on line 201 or anywhere else in the file.
I'm stumped.
- dave myers
Comment #17
davydog CreditAttribution: davydog commentedI'd like to test out this patch.
Not clear where and how to apply it (the specific file in which to insert the patch, and exactly where the insertion point is).
I'm no coder, so explicit instructions usually come in handy.
It appears that this thread mentions at least two files:
1. update.compare.inc
2. update.report.inc
Is the patch applied to one of these two files? If so, is there a specific point in the file in which to insert the patch?
Thanks,
-dave myers
P.S. My site is running on SQLite, not MySQL.
Comment #18
bfroehle CreditAttribution: bfroehle commentedComment #19
jmones CreditAttribution: jmones commentedsubscribe
Comment #20
webci274 CreditAttribution: webci274 commented#14: 986888-14-fix_undefined_index_with_hidden_base_themes.patch queued for re-testing.
Comment #22
MrPhilbert CreditAttribution: MrPhilbert commentedSubscribing here too. This is showing for all Fusion core and sub themes.
Comment #23
bfroehle CreditAttribution: bfroehle commentedI've reuploaded #14 in the current -p1 diff format.
Comment #24
xjmAnd now it needs a reroll again. :)
Tagging as novice for the task of rerolling the Drupal 8.x patch on account of #22336: Move all core Drupal files under a /core folder to improve usability and upgrades.
If you need help rerolling this patch, you can come to core office hours or ask in #drupal-gitsupport on IRC.
Comment #25
bfroehle CreditAttribution: bfroehle commentedComment #27
xjmNote that there is a testbot issue at the moment, which is why the patch failed. We'll want to re-test it once that is fixed.
Comment #28
bfroehle CreditAttribution: bfroehle commented#25: 986888-now-with-core.patch queued for re-testing.
Comment #30
xjm#1346772: StatisticsLoggingTestCase->testLogging() fails with clean URLs in some environments again... someone please RTBC that patch before I hurt testbot. :)
Comment #31
bfroehle CreditAttribution: bfroehle commentedComment #32
xjmThe patch looks good to me. We should be able to add tests for this.
Comment #33
bfroehle CreditAttribution: bfroehle commentedTests might have to wait for #953336: Contributed modules are not able to test theme-related functionality, but should be easy to write.
Comment #34
netdesignate CreditAttribution: netdesignate commentedI am getting this on Fusion_Core:
"Notice: Undefined index: fusion_core in theme_update_report() (line 200 of /var/www/patchxxxxxxx/modules/update/update.report.inc)."
It's been a long time since this was an active thread - did I miss something ?
I am current on all code & modules as of this date...
Comment #35
marcingy CreditAttribution: marcingy commentedPlease do not change version numbers
Comment #36
marcingy CreditAttribution: marcingy commentedComment #37
brephraim CreditAttribution: brephraim commented#12: 986888-12-fix_undefined_index_with_hidden_base_themes.patch queued for re-testing.
Comment #38
kbasarab CreditAttribution: kbasarab commented#25: 986888-now-with-core.patch queued for re-testing.
Comment #40
carsonblack CreditAttribution: carsonblack commentedLooking into writing an automated test.
Comment #41
sonicthoughts CreditAttribution: sonicthoughts commentedGetting this error on adaptive subtheme in a profile.
Comment #42
YesCT CreditAttribution: YesCT commentedI think we are fixing this first in 8.x and then in 7.x.
@carsonblack, it's been awhile. If you want to tackle this again, just post a note. :) Thanks for trying. Tests can be tricky. Otherwise it's available.
Comment #43
sonicthoughts CreditAttribution: sonicthoughts commentedI had to enable the subtheme as a workaround. Can't delete it because it is part of a profile.
Comment #44
grwgreg CreditAttribution: grwgreg commentedI rerolled the patch from post 25, "986888-now-with-core.patch" to apply cleanly to commit 77f0384.
Comment #45
grwgreg CreditAttribution: grwgreg commentedI rerolled the patch from post 25, "986888-now-with-core.patch" to apply cleanly to commit 77f0384.
Comment #46
bdone CreditAttribution: bdone commentedconfirming that patch in #45 removes the warning for base themes with the hidden = TRUE.
status update for automated tests, which are still needed.
Comment #47
bdone CreditAttribution: bdone commentedhere's a pass at adding an automated test with patch in #45. this tests specifically for the undefined index error and the hidden base theme and sub theme combination.
Comment #48
xjmThanks @bdone!
One thing we want to do in general is assert the correct, expected behavior rather than merely asserting that there is no error message. Otherwise, it could be broken in a different way but still pass the test.
Another thing to keep in mind is that the error reporting settings can vary from site to site, so if we are using
assertText()
to check whether an error was reported, we need to make sure the error would be reported. See ErrorHandlerTest for an illustration of how the error handling settings can affect what messages are displayed. In general, I recommend against asserting the absence of an error message, but let's start by looking at the test-only patch (like we discussed in IRC) to make sure it provides coverage.Another thing we could try would be to test the function directly--call
update_process_info_list()
within the test method, instead of visiting a page where it is called with the browser. That way, the error should hopefully be raised in the test environment rather than the child environment, which would cause the test to fail.The summary should be one line of 80 characters or fewer. I'd suggest broadening the method's purpose a little to test hidden base themes in general, like:
In general, assertion message texts should not use
t()
. See: http://drupal.org/simpletest-tutorial-drupal7#tAlso, for
assertText()
andassertNoText()
, the default message is usually sufficiently clear, so we can actually leave off the$message
parameter here.Comment #48.0
xjmbdone: added issue summary
Comment #49
bdone CreditAttribution: bdone commentedThanks for the help and excellent feedback @xjm! Here's another pass at it.
This one incorporates all of your suggestions and (hopefully) gets us a bit closer.
Comment #50
YesCT CreditAttribution: YesCT commented@bdone interdiff please (unless it's a reroll that cannot make one because of merges or conflicts)
Comment #51
bdone CreditAttribution: bdone commented@YesCT: didn't think an interdiff was needed, because i've not actually touched the original patch. i did re-name it, which was probably my mistake. so in #49, 986888-49-complete.patch is actually 986888-44-reroll.patch.
Here's an attempt at fixing that, w/ out re-naming the original patch. would an interdiff still be needed?
Comment #52
bdone CreditAttribution: bdone commentedokay, got a bit confused about which interdiff to provide here. attaching one between 47 and 49 as suggested by @Cottser in #drupal. thanks for helping clear it up!
Comment #53
YesCT CreditAttribution: YesCT commentedlooks like this address. the 80 char. mentioned by xjm. in point 1. of comment #48
and this is good for being more general.
this is both more general than looking for not an error, is looking for correct function. and also takes out the t() in the second argument to the assert.
looks like update_process_info_list is called directly, as requested.
Summary
as best I can tell, the improvements have been made. (looking at the interdiff.)
I am confused though as the recent comment says the patch is the same as 44, but that is before xjm asked for the changes. So I think in comment #51 the test only patch has the improvements, but the complete patch does not contain the test. the "patch" should be both the fix and the tests, not just the fix. (when the committer, commits it, they commit the patch, so that should have both the tests and the patch)
I think there was some confusion there. What we need here is a new patch that has both the tests and the fix. probably to make it easy for the drupal core maintainers, is to include a justs tests along with that (which will probably be a duplicate of tests patch in #51 but that is ok.)
Comment #54
bdone CreditAttribution: bdone commentedhopefully this incorporates feedback from @YesCT correctly...
Comment #55
siretfeL CreditAttribution: siretfeL commented...any luck with the D7 port?...still getting the "Notice: Undefined index: ...theme in theme_update_report() (line 202 of ...\modules\update\update.report.inc)" after (986888-44-reroll_0) patch, even when I enable the base themes (AdaptiveTheme ones) involved...
Comment #56
YesCT CreditAttribution: YesCT commentedok. we are getting completely confused with all these patches. @bdone dont worry much. we will sort out interdiffs on the next issue. :)
I went through this, and test and complete patch in 54 are ok.
Comment #57
catchI really think this should be fixed by #1297856: Base themes should be required dependencies of subthemes and/or #1067408: Themes do not have an installation status instead of adding additional complexity around the system to check for updates of things that aren't registered in the system at all.
Comment #58
YesCT CreditAttribution: YesCT commented@catch how about adding a @todo to convert to those once the are fixed? Or would that conflict with those issues and slow down them?
Those issues are not moving very quickly, and have their own dependencies.
Those issues or their dependencies don't look back portable to d7, would we still use an approach like this one in d7?
I suppose waiting a week or two to see how feature completion shakes down feb 18 in those issues is not too long to wait.
Updating tags (this has tests, and to revisit)
Comment #59
catchHmm given this is a Drupal 7 bug report I don't think we have a choice but to commit it to 8.x then refactor if those other two get fixed.
Back to RTBC.
Comment #59.0
catchUpdated issue summary.
Comment #60
catchCommitted/pushed to 8.x, thanks!
Comment #61
dcam CreditAttribution: dcam commentedBackported #54 to D7.
Comment #62.0
(not verified) CreditAttribution: commentedbdone: updated next steps and manual tests link to latest patch
Comment #64
YesCT CreditAttribution: YesCT commentedComment #68
dcam CreditAttribution: dcam commentedComment #71
dcam CreditAttribution: dcam commentedComment #73
dcam CreditAttribution: dcam commentedOops, this wasn't RTBC anyway. I didn't pay attention while going through and fixing all the random test failures on issue that actually are RTBC.
Comment #74
Kebz CreditAttribution: Kebz commentedIs this the same??
My system is telling me that I have "out of date" modules. So I then click on the link and see that it's listing disabled items or a module I'm not ready to update to. So I proceed and click on the "list" tab (xxx .com/?q=admin/reports/updates/list)
Then these two error messages pop-up. The thing is that I no longer have neither one installed.
Comment #75
Kebz CreditAttribution: Kebz commentedDoes anyone have a solution to get rid of this?
Comment #76
kaicyee CreditAttribution: kaicyee commentedSo are we saying that this issue has not been resolved to date?
Comment #81
mfuller526 CreditAttribution: mfuller526 as a volunteer commented@#17 - the patch needs to be placed in the module: core/modules/update. I know this by seeing component: update.module on this page, also reading code within the patch:
However, patch #54 does not work with D7.51. The paths are incorrect/nonexistent.
Any solution ideas? Thanks.
Comment #82
deanflory CreditAttribution: deanflory as a volunteer commented2017-01-21
Drupal 7.53
Adaptivetheme 7.x-3.x-dev 2016-Dec-01
Comment #85
jday CreditAttribution: jday commentedreroll
Comment #87
maximpodorov CreditAttribution: maximpodorov commentedThe patch in #85 doesn't work in my case:
disabled "seventeen" theme is the sub-theme of disabled "seven" theme.
I get "Notice: Undefined index: seven in theme_update_report() (line 202..."