wiki.module 4.6 to 4.7 update

rport - December 14, 2005 - 15:12
Project:Wiki
Version:HEAD
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I found the following error while testing the wiki.module (4.6.0) on Drupal 4.7.0 beta 1;

Fatal error: Call to undefined function: form_radios() in /modules/wiki/wiki.module on line 71

The related lines lines 70-72 in the module are;

function _wiki_filter_settings($format) {
  $group = form_radios(t('Support Escaped HTML'), "wiki_filter_html", variable_get("wiki_filter_html", WIKI_FILTER_HTML_DISABLE), array(WIKI_FILTER_HTML_ENABLE => t('Enable HTML'), WIKI_FILTER_HTML_DISABLE => t('Disable HTML')), t('Whether to allow |&gt;-escaped HTML.  If set to "enable", then any HTML goes on each line after the |&gt; escape marker.  If set to "disable", then any HTML tags will be shown as is, unless the HTML Filter has been separately enabled.  It is recommended that this be disabled.  Turn on the HTML Filter to support HTML, but make sure the HTML filter applies <em>after</em> the WikiText filter.'));
  $output .= form_group(t('WikiText filter'), $group);

The error occurs when selecting configure when in the Home » administer » input formats administration area.

Russ

#1

alusiani - January 24, 2006 - 17:13

I have patched wiki.module to work with Drupal 4.7 beta3, this is the relevant diff -c output:

***************
*** 68,80 ****
* Settings for the WikiText filter.
*/
function _wiki_filter_settings($format) {
- $group = form_radios(t('Support Escaped HTML'), "wiki_filter_html", variable
_get("wiki_filter_html", WIKI_FILTER_HTML_DISABLE), array(WIKI_FILTER_HTML_ENABL
E => t('Enable HTML'), WIKI_FILTER_HTML_DISABLE => t('Disable HTML')), t('Whethe
r to allow |>-escaped HTML. If set to "enable", then any HTML goes on each l
ine after the |> escape marker. If set to "disable", then any HTML tags will
be shown as is, unless the HTML Filter has been separately enabled. It is reco
mmended that this be disabled. Turn on the HTML Filter to support HTML, but mak
e sure the HTML filter applies after the WikiText filter.'));
- $output .= form_group(t('WikiText filter'), $group);

! return $output;
}

-
define("WIKI_ZERO_LEVEL", 0);
define("WIKI_NESTED_LEVEL", 1);
define("WIKI_FIELD_SEPARATOR", "\263");
--- 76,98 ----
* Settings for the WikiText filter.
*/
function _wiki_filter_settings($format) {

! $the_form = array();
! $the_form['wiki_settings'] =
! array('#type' => 'fieldset',
! '#title' => t('WikiText filter'),
! '#collapsible' => TRUE,
! '#collapsed' => TRUE);
! $the_form['wiki_settings']['enable_html_${format}'] =
! array(
! '#type' => 'checkbox',
! '#title' => t('Enable HTML'),
! '#default_value' => variable_get("enable_html_${format}", 0),
! '#description' => t('Whether to allow |>-escaped HTML. If enable
d, then any HTML goes on each line after the |> escape marker. If disabled,
then any HTML tags will be shown as is, unless the HTML Filter has been separate
ly enabled. It is recommended that this be disabled. Turn on the HTML Filter t
o support HTML, but make sure the HTML filter applies after the WikiTex
t filter.'));
!
! return $the_form;
}

define("WIKI_ZERO_LEVEL", 0);
define("WIKI_NESTED_LEVEL", 1);
define("WIKI_FIELD_SEPARATOR", "\263");

I'll be glad to send my patches (I did a few other ones) to whoever would like to test them and/or to insert them into CVS.

I attach the wiki.module I am currently using.

Greetings,

AttachmentSize
wiki.module 26.55 KB

#2

tachyonxv - January 24, 2006 - 19:13
Version:4.6.x-1.x-dev» HEAD

+1 to fixing this. Its to do with the new forms API in 4.7 / CVS and will bring the module up to date with CVS.

#3

sami_k - April 3, 2006 - 23:51
Title:wiki.module call to undefined function error» wiki.module 4.6 to 4.7 update

Please submit a patch instead of the module so the maintainer may update the module.

#4

sami_k - April 4, 2006 - 00:07
Status:active» needs review

patch made from the above module and cvs using unified diff. seems good to me, testing it now.

AttachmentSize
wiki-update-47.patch 6.06 KB

#5

sami_k - April 4, 2006 - 00:09

works for me!

 
 

Drupal is a registered trademark of Dries Buytaert.