Skip to content
  1. Feb 25, 2011
  2. Aug 17, 2006
  3. Mar 27, 2006
  4. Feb 21, 2006
  5. Jan 29, 2006
  6. Jan 20, 2006
    • Dries Buytaert's avatar
      - Patch #45530 by Morbus: filter_form shouldn't default to #weight 0 · 8c02d4ec
      Dries Buytaert authored
      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.
      8c02d4ec
  7. Jan 19, 2006
  8. Jan 18, 2006
  9. Dec 15, 2005
  10. Dec 05, 2005
  11. Dec 02, 2005
  12. Nov 23, 2005
  13. Nov 12, 2005
  14. Nov 01, 2005
  15. Oct 28, 2005
  16. Oct 11, 2005
  17. Oct 07, 2005
  18. Sep 23, 2005
  19. Aug 30, 2005
    • Dries Buytaert's avatar
      - Patch #7582 by Gerhard: improved node revisions! · d9d6a6e0
      Dries Buytaert authored
      All node revisions were stored in a serialized field in the node table and retrieved for _each_ page view although they are rarely needed. We created a separate revisions table which would be in principle identical to the node table, only that it could have several old copies of the same node.  This also allows us to revision-related information, and to provide log entries to non-book pages when a new revision is being created.
      
      TODO:
      
      1. Provide upgrade instructions for node module maintainers!
      2. Upgrade modules that implement node types.
      3. Provide an upgarde path for revisions.  Dependency on the upgrade system.
      d9d6a6e0
  20. Aug 29, 2005
  21. Aug 28, 2005
    • Dries Buytaert's avatar
      - Patch #29785 by Chx: multiple node types were broken so we refactored · c9fc300b
      Dries Buytaert authored
        part of the node system!  If you have a module that implements node
        types, you'll have to udpate its CVS HEAD version.
      
        We replaced _node_name() and _node_types() by _node().  The new _node()
        hook let's you define one or more node types, including their names.
        The implementation of the _node() hook needs to:
      
         return array($type1 => array('name' => $name1, 'base' => $base1),
                      $type2 => array('name' => $name2, 'base' => $base2));
      
        where $type is the node type, $name is the human readable name of the type
        and $base is used instead of <hook> for <hook>_load, <hook>_view, etc.
      
        For example, the story module's node hook looks like this:
      
          function story_node() {
            return array('story' => array('name' => t('story'), 'base' => 'story'));
          }
      
        The page module's node hook module like:
      
          function page_node() {
            return array('page' => array('name' => t('page'), 'base' => 'page'));
          }
      
        However, more complex node modules like the project module and the
        flexinode module can use the 'base' parameter to specify a different base.
      
        The project module implements two node types, proejcts and issues, so it
        can do:
      
          function project_node() {
            return array(
             array('project_project' => array('name' => t('project'), 'base' => 'project'),
             array('project_issue' => array('name' => t('issue'), 'base' => 'project_issue'));
          }
      
        In the flexinode module's case there can only one base ...
      
        This hook will simplify the CCK, and will make it easy (or easier) to merge
        the story and page module.
      
        In addition, node_list() became node_get_types().  In addition, we created
        the following functions: node_get_name($type) and node_get_base($type).
      c9fc300b
  22. Aug 25, 2005
  23. Feb 08, 2005
  24. Jan 26, 2005
  25. Jan 25, 2005
  26. Dec 07, 2004
    • Dries Buytaert's avatar
      · 60352821
      Dries Buytaert authored
      - Refactored the queue module: removed the queue module's field from the node table.  With help from Gerhard.
      
      - Slight addition to INSTALL.txt with regard to PHP versions.
      
      - Updated/reworded some node type descriptions as per Boris' suggestions.
      
      - Adding missing {} around a table name in update.php.
      60352821
  27. Oct 23, 2004
  28. Sep 29, 2004
    • Dries Buytaert's avatar
      · 98b11655
      Dries Buytaert authored
      - Removed the link feature.  It was death code, bound to confuse people.
      
        TODO after Drupal 4.5.0: clean up the page module and remove additional cruft.
      98b11655
  29. Sep 28, 2004
  30. Sep 16, 2004
    • Dries Buytaert's avatar
      · 5c7983c4
      Dries Buytaert authored
      - Patch #8179 by JonBob: reintroduced menu caching.
      5c7983c4
  31. Aug 21, 2004
    • Dries Buytaert's avatar
      · 94e30bf7
      Dries Buytaert authored
      - Patch by JonBob: for consistency and readability, add brief descriptions of each source file inside the @file comment block at the head of the file. This helps with Doxygen indexing, and also allows neophytes to see what a file does immediately on opening the source, regardless of the organization of the hooks.
      94e30bf7
  32. Aug 10, 2004
    • Steven Wittens's avatar
      The Input formats - filter patch has landed. I still need to make update... · 660f9928
      Steven Wittens authored
      The Input formats - filter patch has landed. I still need to make update instructions for modules and update the hook docs.
      
      Here's an overview of the changes:
      1) Multiple Input formats: they are complete filter configurations (what filters to use, in what order and with which settings). Input formats are admin-definable, and usage of them is role-dependant. For example, you can set it up so that regular users can only use limited HTML, while admins can free HTML without any tag limitations.
      The input format can be chosen per content item (nodes, comments, blocks, ...) when you add/edit them. If only a single format is available, there is no choice, and nothing changes with before.
      
      The default install (and the upgrade) contains a basic set of formats which should satisfy the average user's needs.
      
      2) Filters have toggles
      Because now you might want to enable a filter only on some input formats, an explicit toggle is provided by the filter system. Modules do not need to worry about it and filters that still have their own on/off switch should get rid of it.
      
      3) Multiple filters per module
      This was necessary to accomodate the next change, and it's also a logical extension of the filter system.
      
      4) Embedded PHP is now a filter
      Thanks to the multiple input formats, I was able to move the 'embedded PHP' feature from block.module, page.module and book.module into a simple filter which executes PHP code. This filter is part of filter.module, and by default there is an input format 'PHP', restricted to the administrator only, which contains this filter.
      This change means that block.module now passes custom block contents through the filter system.
      As well as from reducing code duplication and avoiding two type selectors for page/book nodes, you can now combine PHP code with other filters.
      
      5) User-supplied PHP code now requires <?php ?> tags.
      This is required for teasers to work with PHP code. Because PHP evaluation is now just another step in the filter process, we can't do this. Also, because teasers are generated before filtering, this would result in errors when the teaser generation would cut off a piece of PHP code.
      
      Also, regular PHP syntax explicitly includes the <?php ?> tags for PHP files, so it makes sense to use the same convention for embedded PHP in Drupal.
      
      6) Filter caching was added.
      Benchmarking shows that even for a simple setup (basic html filtering + legacy URL rewriting), filtercache can offer speedups. Unlike the old filtercache, this uses the normal cache table.
      
      7) Filtertips were moved from help into a hook_filter_tips(). This was required to accomodate the fact that there are multiple filters per module, and that filter settings are format dependant. Shoehorning filter tips into _help was ugly and silly. The display of the filter tips is done through the input format selector, so filter_tips_short() no longer exists.
      
      8) A more intelligent linebreak convertor was added, which doesn't stop working if you use block-level tags and which adds <p> tags.
      660f9928
  33. Jul 31, 2004
  34. Jul 30, 2004
    • Dries Buytaert's avatar
      · aed1b0ca
      Dries Buytaert authored
      - Patch #5347 by JonBob:
      
      Here's a new patch that unifies the node/52 and book/view/52 paths for nodes. It involves a small change to hook_view(), which is discussed first:
      
      Currently hook_view() expects node modules to return a themed node. However, each module does this the same way; they modify $node as necessary, then call theme('node', $node) and return the result. We can refactor this so that the calling function node_view() calls theme('node') instead. By doing this, it becomes possible for hook_nodeapi('view') to be called after hook_view() where the node contents are filtered, and before theme('node') where the body is enclosed in other HTML. This way the book module can insert its navigation into the body right before the theming.
      
      Advantages of this refactoring:
      - I can use it for book.module to remove the extra viewing path.
      - The function of hook_nodeapi('view') becomes more like hook_view(), as neither will expect a return value.
      - We more closely follow the flow of other nodeapi calls, which usually directly follow their corresponding specific node type hooks (instead of preceding them).
      - The attachment.module people could use it to append their attachments in a list after the node.
      - Gabor could use it instead of his filter perversion for his "articles in a series" module.
      - A little less code in each view hook.
      - The content hook is no longer needed, so that means even less code.
      
      Disadvantages:
      - Any modules written to use nodeapi('view') could be affected (but these would all be post-4.4 modules).
      - Implementations of hook_view() would need to be updated (but return values would be ignored, so most would work without updates anyway).
      
      Now the patch takes advantage of this API shift to inject its navigation at the end of all book nodes, regardless of the viewing path. In fact, since the paths become identical, I've removed the book/view handler entirely. We should probably provide an .htaccess rewrite for this (one is still needed for node/view/nn anyway). At the same time, there is a check in book_block() that shows the block appropriately on these pages.
      aed1b0ca
  35. Jul 13, 2004
    • Dries Buytaert's avatar
      · 1c52b145
      Dries Buytaert authored
      - Patch #8080 by TDobes: added teaser support to the book and page module.
      1c52b145
    • Dries Buytaert's avatar
      · 3613729d
      Dries Buytaert authored
      - Patch #8398 by TDobes: changed permissions for the blog, story, and page modules (and all occurrances elsewhere) to match their 4.4.x equivalents.  In the discussion when these permissions were introduced, it was decided that "edit own ..." was clearer, but "maintain personal ..." slipped into CVS HEAD anyway, while "edit own ..." landed in the 4.4.x branch.
      
      Changes are as follows:
      "maintain personal blog" -> "edit own blog" (aggregator.module, blog.module, blogapi.module)
      "maintain personal pages" -> "edit own pages" (page.module)
      "maintain personal stories" -> "edit own stories (story.module)
      3613729d
  36. Jul 08, 2004
    • Dries Buytaert's avatar
      · 898bdeff
      Dries Buytaert authored
      - Marked required fields on the node (story, book, page, blog) and comment
        forms using the $required argument of the form_ functions.
      
      - Replaced all Optional's and Required's from the taxonomy forms with proper
        use of the form_ functions.
      
      Please check your contributed modules too!
      898bdeff