Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
theme system
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
19 Apr 2010 at 04:33 UTC
Updated:
1 Jun 2010 at 15:20 UTC
Jump to comment: Most recent file
1. Install core
2. Go to node/add/article
3. Go to admin/reports/dblog and see that there is a watchdog error message "Theme key "node_form" not found."
This should not be happening on a fresh install, or we need to downgrade this error message. This is absolutely messing on tests in XML sitemap that checks if the watchdog table doesn't have any errors or warnings during its tearDown() function.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 775012-node-form-theme-key-watchdog-D7.patch | 675 bytes | dave reid |
Comments
Comment #1
boombatower commentedsubscribe
Comment #2
qasimzee commentedsubscribe
Comment #3
bshort commentedSubscribe
Comment #4
dmitrig01 commentedBonus points (but a separate bug): click the link (assuming the overlay is installed) to node/add/article?render=overlay
Comment #5
douggreen commentedThe problem is coming from node.pages.inc+278, what is this supposed to be:
Comment #6
dmitrig01 commentedI've got this one. The problem is much deeper.
Comment #7
iLLin commentedI have tracked this issue to theme.inc
If no $hook was found in the $hooks array then the last hook iterated through the foreach loop is put as the value of $hook. $hook = $candidate. The array passed as $hook contains two values: $node_type_node_form and node_form. There is no theme hook defined as either of these. So one of two things needs to happen (I think). There needs to be a theme implementation of node_form (Is this missing on purpose? It was available in 6.). Or there needs to be a graceful failout instead of logging a watchdog.
Thoughts?
Comment #8
mgriego commentedThis is related to #596582: Remove remnants of theme_node_form(). It looks like theme_node_form was removed on purpose. Actually, looking further, the node_form looks like it's being replaced with node_edit_form. And, in fact, it looks like the whole $node-type.'_node_form' system no longer works like it was before. Maybe in the middle of a switch to using a single node_edit_form instead of distinct node type _node_form forms?
Comment #9
EvanDonovan commentedI have noticed this at least for the last month (since alpha3), but didn't report it, since I thought someone else had. Sorry, I should've checked.
Comment #10
yoroy commenteddmitrig01: any chance on an update? Let us know what's up.
Comment #11
nancydrusubscribe
Comment #12
pwolanin commentedseeing this also.
Comment #13
dave reidI think this is the only solution then.
Comment #14
moshe weitzman commentedfine with me. its easy enough to form alter and add a #theme
Comment #15
dries commentedCommitted to CVS HEAD. Thanks.
Comment #16
nancydruIndeed, the errors are gone. Thanks.
Comment #17
sunNot sure whether this was the right fix.
Effectively, this means that the behavior for a single theme hook (string) is different to the behavior for theme hook suggestions (array).
That is, because http://api.drupal.org/api/function/drupal_build_form/7 automatically assigns $form_id as #theme hook, if #theme is not defined (which no longer is). In turn, this means that the node_form still has a #theme defined, and still points to a non-existing theme hook, but just because it's a single hook suggestion, instead of an array of suggestions, it "suddenly" doesn't throw a watchdog warning.
Now, after writing this down, I am sure this was the wrong fix.
Comment #18
effulgentsia commentedI believe this fix was okay. theme() is consistent in throwing a watchdog when a single passed $hook isn't implemented, or if none of the items in the array are implemented. drupal_build_form() only sets #theme if the $form_id exists as a hook in the registry. Perhaps restoring the functionality lost by #13 can be rolled into #757154: Base form_id via hook_forms() not taken into account for #validate, #submit, hook_form_FORMID_alter(), but with the registry checks that drupal_build_form() does?