Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
node system
Priority:
Minor
Category:
Feature request
Assigned:
Reporter:
Created:
22 Jul 2007 at 22:00 UTC
Updated:
13 Mar 2010 at 01:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
moshe weitzman commentedoh yes, this is far too messy right now. subscribe.
Comment #2
catchno longer applies. Probably small enough it could squeeze into this version though.
Comment #3
moshe weitzman commentedanyone available to reroll and rtbc this?
Comment #4
panchoMoving feature requests to D7 queue.
Comment #5
moshe weitzman commentedBack from the dead, and ready for review. The whole test suite is passing for me.
Comment #6
moshe weitzman commentedNow, with a period at end of a comment, as suggested by Catch.
Comment #7
webchick+100 for something nicer than
This patch is a really nice DX improvement.
However, why:
Since $form['#node'] is set on any form where $form['#node_edit_form'], you can just use $form['#node']->type same as you use $form['#node']->nid or any other node property. Then that makes one less FAPI property for people to know about.
Comment #8
eaton commentedYeah, I concur that the #node_type property is overkill. checking for #node to ensure that it's a node edit form is risky, but once we know it's a node edit form, we can very easily check its type. Thanks to PHP eval order, the following works nicely:
if (!empty($form['#node_edit_form']) && $form['#node']->type == 'blog') {...}Comment #9
webchickCool. Let's remove that (doesn't seem to be used anywhere in the patch) and get correct the "// Set the id of the top-level form tag" comment so it correctly reflects what the code below is doing now.
Comment #10
webchickMy mistake, I was looking at an earlier patch "+ // Set the id and other useful elements." capitalize ID please.
Also, I don't see a hunk for book.module? Are there other ones we're missing too?
Comment #11
moshe weitzman commentedRemoved that extra line which set the type. I did *not* change id to ID because I refer to the HTML id attribute which is almost always lowercase.
I added the book.module hunk. I searched for more instances of this node form check but found none more in core.
Comment #12
sunRe-rolled with appropriate menu.module changes.
Comment #13
dries commentedLooks like a small but valuable improvement and all tests continue to pass. Committed to CVS HEAD.
Comment #14
webchickDocs, please! :D
* Need an update to the upgrading docs
* Need an update to the FAPI reference for HEAD.
Comment #15
moshe weitzman commentedAdded to upgrade guide http://drupal.org/node/224333#node_form ... I'm not touching that FAPI reference doc though. I proposed an alternate solution for that doc but it has not been embraced yet - #100680: [meta] Make API module generate Form API documentation
Comment #16
sun.
Comment #17
sun.