Mathfilter_menu() throws missing argument error is Drupal 6.0 RC1

brettalton - January 3, 2008 - 17:09
Project:Mathematics Filter
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

warning: Missing argument 1 for mathfilter_menu() in /var/www/altonlabs.com/dev/altonlabs/public_html/modules/mathfilter/mathfilter.module on line 16.

#1

dwees - January 4, 2008 - 09:46

I upgraded this module to version 6 rather early in the cycle, and this is actually a sign of larger problems. Let me post a warning on the release for this module so that no one else tries to use it until I get a chance to fix it.

Unfortunately this may take a while to fix as I have more pressing matters I am working on in real life. If anyone wants to take the lead on fixing this module, please go ahead.

Dave

#2

mydllurth - February 16, 2008 - 05:11

I'm not a module developer, but maths are useful to my projects. I was able to duplicate this warning, and subsequently eliminate it with a single change to mathfilter.module. I hope this patch helps.

diff mathfilter.module mathfilter.module.orig
16c16
< function mathfilter_menu() {
---
> function mathfilter_menu($may_cache) {

#3

stattalk - May 12, 2008 - 01:16

I just removed $may_cache from the following line (line 16 in the mathfilter.module) and that seems to be working for me.

function mathfilter_menu($may_cache) {

#4

dwees - August 30, 2008 - 08:23

It shouldn't work fine, you probably can't access the settings page now. I've upgraded this module on my personal computer and will commit the changes as soon as I remember how to do it.

#5

stattalk - March 7, 2009 - 16:49

Could you please send me the updates that you've made? Thanks.

#6

DjAndrey - April 16, 2009 - 14:52

In order to access settings page just correct mathfilter_menu() function in mathfilter.module:

<?php
function mathfilter_menu() {
 
$items = array();

 
$items['admin/settings/mathfilter'] = array(
   
'title' => t('Mathfilter'),
   
'description' => t('Set the URL to the Mimetex binary and other settings.'),
   
'page callback' => 'drupal_get_form',
   
'page arguments' => array('mathfilter_settings_form'),
   
'access arguments' => array('administer site configuration'),
  );
  return
$items;
}
?>

Also I've added mathfilter_filter_tips to allow users to see appropriate tip

<?php
function mathfilter_filter_tips($delta, $format, $long = FALSE) {
  return
t('Mathematical equations and graphs can be added between [tex] and [/tex], [graph] and [/graph] tags.');
}
?>

Or just download attached file, unzip and replace existing.

AttachmentSize
mathfiltermodule.zip 3.08 KB
 
 

Drupal is a registered trademark of Dries Buytaert.