View Issue Details

IDProjectCategoryView StatusLast Update
0011769mantisbtintegrationpublic2012-12-11 17:06
Reportercombr Assigned Todregad  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Product Version1.2.0 
Target VersionFixed in Version 
Summary0011769: Many cross-definitions of utf8 functions with dokuwiki
Description

Mantis have an integration instruction on
http://www.mantisbt.org/wiki/doku.php/mantisbt:issue:7075:integration_with_dokuwiki

for the http://www.mantisbt.org/bugs/view.php?id=7075

In 1.2.0 mantis has many changes in working with utf-8 strings and add many functions to work with unicode.

BUT! at the same time dokuwiki have this functions too ;)
And when I follow this instruction (authtype=mantis in dokuwiki and try to load dokuwiki site) ) I get many php errors like

PHP Fatal error: Cannot redeclare utf8_to_unicode() (previously declared in ..dokuwiki/inc/utf8.php:611) in mantis/library/utf8/utils/unicode.php

this functions are:

function utf8_to_unicode
function utf8_substr_replace
function utf8_strlen
function utf8_strpos
function utf8_substr
function utf8_strtolower
function utf8_strtoupper

All of it already declared and realized in dokuwiki/inc/utf8.php

And when dokuwiki starts, it load at first its own functions
(it defined with if(!function_exists('utf8_strlen')) , but at the moment it is not defined)

and then mantis functions via
$conf['authtype'] = 'mantis';
and dokuwiki/inc/auth/mantis.class.php
require_once( MANTIS_ROOT . 'core.php' );

What way we can choose to resolve this conflict?
Maybe some cooperation with Dokuwiki Project?

Steps To Reproduce

follow inegraion instruction, set authtype=mantis in dokuwiki and try to load dokuwiki site

TagsNo tags attached.

Relationships

has duplicate 0011018 closeddregad dokuwiki Integration: multiple utf8 string wrapper redeclarations 

Activities

combr

combr

2010-04-23 04:48

reporter   ~0025224

additional: when i install php5-mbstring (it was not installed) i got a new branch of similar errors:

[Fri Apr 23 12:22:39 2010] [error] [client 10.1.4.14] PHP Fatal error: Cannot redeclare utf8_strlen() (previously declared in /var/www/vhosts/mantis/dokuw
iki/inc/utf8.php:132) in /var/www/vhosts/mantis/library/utf8/mbstring/core.php on line 28, referer: http://mantis.local/view_all_bug_page.php

and wiki don't work again.

if i patch it again in mantis with if(!function_exists('utf8_strlen')) it again start working, i think. But i remove php5-mbsting, and it start to work again.

combr

combr

2010-04-23 05:24

reporter   ~0025227

David Hicks <hickseydr> wrote:

"MantisBT 1.3.0 introduces a new require_lib() function to include
library files so this should make it a little easier than having random
require_once() calls all over the place."

maybe it helps in future.

andrej.pavlovic

andrej.pavlovic

2010-04-27 02:19

reporter   ~0025279

Adding the following line in dokuwiki/conf/local.php will resolve this issue:

require_once( MANTIS_ROOT . 'core.php' );

Make sure to add it somewhere after the line where MANTIS_ROOT is refined.

The reason this should work is because Mantis will define all the UTF8 functions first, and then DokuWiki won't try to define them again, because it checks if they are already defined.

tiliarou

tiliarou

2011-01-24 12:01

reporter   ~0028051

adding require_once( MANTIS_ROOT . 'core.php' ); doesn't solve anything for me :(
I get a blank page...

Ray_Cheng

Ray_Cheng

2011-05-06 01:31

reporter   ~0028757

require_once( MANTIS_ROOT . 'core.php' ); dosen't solve this problem...

toddpw

toddpw

2011-08-15 11:42

reporter   ~0029479

It solves it for me. I am updating the integration instructions in the Wiki to cover everything I ran into while integrating the latest stable versions of both packages (mantis 1.2.6, dokuwiki 2011-05-25a).

toddpw

toddpw

2011-08-15 12:51

reporter   ~0029480

Ok, scratch that, there is another probably unrelated problem preventing it from working. I already fixed one typo that caused a blatant failure in the mantis auth backend, so that raises the question of whether the plugin file has been corrupted at some point. (Another good reason to put whole source files in attachments...) Anyway, I will get back to this later today.

toddpw

toddpw

2011-08-19 02:54

reporter   ~0029516

Okay, I have gotten things working pretty nicely actually, however there are quite a few pitfalls that were not mentioned and I seem to have stumbled over all of them while getting this working. I updated the Wiki instructions at http://www.mantisbt.org/wiki/doku.php/mantisbt:issue:7075:integration_with_dokuwiki and added a number of tips that should help.

dregad

dregad

2012-11-29 10:18

developer   ~0034427

With toddpw's updates to the wiki page (thanks for that !), I assume this issue can be resolved.

Feel free to reopen if that is not the case

Issue History

Date Modified Username Field Change
2010-04-08 08:58 combr New Issue
2010-04-23 04:48 combr Note Added: 0025224
2010-04-23 05:24 combr Note Added: 0025227
2010-04-27 02:19 andrej.pavlovic Note Added: 0025279
2011-01-07 18:20 vboctor Relationship added related to 0011018
2011-01-24 12:01 tiliarou Note Added: 0028051
2011-05-06 01:31 Ray_Cheng Note Added: 0028757
2011-08-15 11:42 toddpw Note Added: 0029479
2011-08-15 12:51 toddpw Note Added: 0029480
2011-08-19 02:54 toddpw Note Added: 0029516
2012-11-29 10:16 dregad Relationship replaced has duplicate 0011018
2012-11-29 10:18 dregad Note Added: 0034427
2012-11-29 10:18 dregad Status new => resolved
2012-11-29 10:18 dregad Resolution open => no change required
2012-11-29 10:18 dregad Assigned To => dregad
2012-12-11 17:06 atrol Status resolved => closed