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
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
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
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
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
Could you please send me the updates that you've made? Thanks.
#6
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
<?phpfunction 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.