Commit Graph

590 Commits (ca9f0fab45823c49947b218587b9c9ef92aff60c)

Author SHA1 Message Date
Dries Buytaert 8c02d4ec93 - Patch #45530 by Morbus: filter_form shouldn't default to #weight 0
When a form element doesn't specify a #weight, it is assumed internally as #weight 0. However, to ensure that our form elements display visually *as they were defined in the array* we, in form_builder, count the number of elements, divide by 1000, and set that as the weight:

# Assign a decimal placeholder weight to preserve original array order
if (!isset($form[$key]['#weight'])) {
  $form[$key]['#weight'] = $count/1000;
}

The above code will set the #weights of elements that have not defined a weight to something like 0 (first element in array definition), 0.001, 0.002, and so on. However, anytime a form element *explicitly* defines a #weight of 0, that #weight is kept at exactly 0, which would cause that form element to appear BEFORE the elements that didn't have a #weight defined (and thus received a #weight such as 0.002).

Consider the following pseudo example:

$form['game_title'] = array(
    '#type' => 'textfield',
    ...
    );
$form['game_description'] = array(
    '#type' => 'textarea',
    ...
    );
$form['game_format'] = filter_form(variable_get('game_format', NULL));
return $form;

Here, we're not definiing weights on our two textfields. We then add an filter_form. The second parameter of the filter_form is $weight, which defaults to 0. After this $form hits form_builder, we have weights 0 (game_title), 0.001 (game_description), and 0 (filter_form) respectively. This is then sorted by weight, which causes filter_form (the third element in the array) to appear BEFORE game_description (0 is lighter than 0.001).

The short lesson is: explicitly defining #weight 0 for a form element is probably a bad idea. This patch changes the default #weight of filter_form to NULL, instead of 0, and also removes any other explicit setting of #weight to 0 in core.
2006-01-20 09:04:34 +00:00
Dries Buytaert e84a98a22b - Patch #45349 by Morbus Iff: input filters aren't sorting correctly infForms API. 2006-01-19 08:54:41 +00:00
Steven Wittens ecd26ac8ae - #42277: Make node search indexing more robust against bad nodes and timeouts. 2006-01-18 21:31:40 +00:00
Dries Buytaert 2220c03633 - Patch #45206 by markus: attempt at making the node filters somewhat translatable. 2006-01-18 19:09:46 +00:00
Dries Buytaert 46913a7efd - Patch #45259 by chx/drumm: cast to object required. 2006-01-18 14:30:42 +00:00
Dries Buytaert 186ebd18da - Patch #42072 by m3avrck: more improvements to the node revesion overview screen. 2006-01-17 21:19:43 +00:00
Dries Buytaert baaf319c59 - Patch #42072 by m3avrck: improved the revision overview screen. 2006-01-17 19:26:49 +00:00
Dries Buytaert 51d2ac2b9e - Critical feature #40670: made the form array accessible. 2006-01-17 17:42:29 +00:00
Dries Buytaert baa5c2ff89 - Extended the form description for clarity. 2006-01-14 09:51:57 +00:00
Dries Buytaert 7f87b19eeb - Patch #42886 by chx: critical feature: allow modules to be reordered. 2006-01-08 12:49:51 +00:00
Dries Buytaert 859e045db6 - Patch #42955 by Cvbge: critical bugfix: users can't create new content. 2006-01-06 16:21:34 +00:00
Steven Wittens c27b62b182 - #41940: Locale string search broken in some cases (and remove some inappropriate db_escape_string() usage)
- #43491: Missing drupal_goto() after saving settings
2006-01-05 23:35:34 +00:00
Dries Buytaert 9e23a23d73 - Patch #35770 by DriesK: make node preview settings work. 2006-01-04 09:04:27 +00:00
Dries Buytaert db92352671 - Patch #43032 by Steve Dondley: critical fix: can't update nodes by anonymous users. 2006-01-03 19:40:29 +00:00
Dries Buytaert ea2d791095 - Patch 41169 by Chris: got rid of expensvie object 2 array casts. 2005-12-31 10:48:56 +00:00
Steven Wittens 79a193a2d2 - #42234: Use standardized feed icon for RSS 2005-12-29 04:46:40 +00:00
Dries Buytaert 02eb24bfbd - Bug #42107: redirect to the main page instead of to 'node'. 2005-12-27 14:31:42 +00:00
Dries Buytaert ed7256f37a - Patch #28159 by chx: removed some dead code from the search module's form. 2005-12-26 11:21:19 +00:00
Dries Buytaert ba12462fc9 - Patch #42153 by Junyor: slight clean-up of node_revision_delete(). 2005-12-24 13:05:22 +00:00
Dries Buytaert 29a619b598 - Patch #30098 by killes: node revisions should only be viewable by admins. 2005-12-22 10:57:02 +00:00
Steven Wittens c2384e2c18 - #41973: Ensure -\>changed and -\>created are equal on node creation 2005-12-22 00:22:19 +00:00
Steven Wittens 19aad8934f - #34826: Search results don't include last part of longer pages 2005-12-21 14:30:09 +00:00
Dries Buytaert 922a46d281 - Patch #34920 by Morbus/webchick/tangent: fixed order of form fields. 2005-12-15 16:24:40 +00:00
Dries Buytaert 5accfa08f5 - Patch #41133 by DriesK: as of PHP 5.1.0, strtotime() returns FALSE on failure instead of -1.
Changed code to be compatible with all versions.
2005-12-15 16:02:50 +00:00
Dries Buytaert 264f7d5667 - Patch #41211 by Neil: de-dupe XML namespaces in RSS automatically. 2005-12-15 15:57:55 +00:00
Dries Buytaert 764f1177ef - Patch #40631 by Chris Johnson: is_array() slower than isset() or empty(). 2005-12-14 20:10:45 +00:00
Dries Buytaert 7334f7624f - Patch #41165 by Morbus: removed rss doctype. 2005-12-14 19:04:27 +00:00
Dries Buytaert c11080c02e - Patch #41109 by chx: fixed problem with _node_name() returning NULL instead of array() when there are no node types. 2005-12-14 13:26:39 +00:00
Dries Buytaert 2659fadd5f - Patch #40587 by wtanaka: execute -> submit 2005-12-10 08:12:59 +00:00
Dries Buytaert aba547258a - Patch #36429: remove CONCAT() and speed up node_access query. 2005-12-08 15:30:27 +00:00
Dries Buytaert 94d6b9abf0 - Patch #29326 by Morbus: optimized performance of URL aliasing for newly installed sites.
There are a number of small optimizations we could add; like, we should never do more lookup queries than the number of unique URL aliases in the database.  When the size of the static cache equals the number of unique URL aliases in the database, we can stop doing lookups.  I think this could be implemented with a 2-line change.  Takers?
2005-12-07 20:57:45 +00:00
Dries Buytaert 28fdb3975e - Patch #39778 by chx: obliterate nodeapi op form in favor of the forms API's way of doing things. Tested with help from webchick. 2005-12-05 09:11:33 +00:00
Dries Buytaert 26bd449860 - Patch #39576 by chx: rename '_execute' to '_submit' and '#execute' to '#submit'. 2005-12-02 15:21:01 +00:00
Steven Wittens b9415b4b9c - #7940: Remember publishing options when editing node 2005-11-29 03:18:57 +00:00
Dries Buytaert c647b39c2c - Patch #37798 by Neil: fixed problem with node settings. 2005-11-27 11:11:46 +00:00
Dries Buytaert b1b1e2045f - Patch #37798 by Neil: allow non-workflow form elements on the node type settings page. 2005-11-25 10:11:59 +00:00
Steven Wittens 02d7e96309 - #35142: Fix mass delete 2005-11-24 22:03:40 +00:00
Dries Buytaert 12c5416dbf - Patch #38593 by malex: generate 'guid' in RSS feeds to work around some aggregator glitches. 2005-11-24 20:15:09 +00:00
Dries Buytaert d4692d569c - Patch #35644 by webchick: fixed the sizes of the textareas on the node edit forms. 2005-11-23 16:18:28 +00:00
Dries Buytaert 03dda45573 - Patch #37752 by chx and Richard: renamed #post_process to #after_build. 2005-11-21 18:10:26 +00:00
Dries Buytaert 9317291284 - Patch #37926 by asimmonds/chx: fixed previewing nodes. 2005-11-18 14:09:42 +00:00
Dries Buytaert f69503aa58 - Patch #37777 by asimmonds: form_id missing from rendered admin/node form. 2005-11-17 06:48:25 +00:00
Steven Wittens fd6104cf4d #37390: Make welcome text link to admin/settings 2005-11-13 02:43:33 +00:00
Dries Buytaert aeed4cd8e4 - Patch #35644 by webchick: forms API simplificiations. 2005-11-12 11:26:16 +00:00
Steven Wittens 85492ae9a5 #36791: node_validate was called twice 2005-11-12 02:54:13 +00:00
Dries Buytaert b4644f8e66 - Patch #36250 by hunmonk: admin batch delete broken, node_delete needs reworked.
This commit changes the node_delete() API.  A list of affected modules is available at http://drupal.org/node/36250#comment-52963.
2005-11-04 19:40:28 +00:00
Dries Buytaert a8b218827a - Patch #26139 by webchick / Kieran / documentation team: improved admin help of core modules! / 2005-11-01 10:17:34 +00:00
Dries Buytaert ef7d2c8a9f - Patch #34920 by tangent: reorganized the node submission form a bit. 2005-10-28 14:04:20 +00:00
Steven Wittens fe938b844a - #35434: Form API - obsolete $param to hook_form() + preview fixes 2005-10-28 00:28:14 +00:00
Steven Wittens 34fcf45def - #35284: fixing node form 2005-10-26 14:49:59 +00:00