Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#141 undefined method ProtocolFieldCriteria::protocolfieldcriteri

BASE
closed-accepted
nobody
Interface (166)
5
2006-09-01
2006-07-11
ajos1
No

-

New to BASE (and Acid)...

Only the front page of Base works correctly... as
soon as I try anything...
like: /base/base_stat_ports.php?port_type=1&proto=-1

Then I get...

Fatal error: Call to undefined method
ProtocolFieldCriteria::protocolfieldcriteria()
in /var/www/html/base/includes/base_state_citems.inc.p
hp on line 1025

It looks like something to do with local/global class
definitions... at a guess... from a non-knowledgable-
point-of-view on classes.

I am:

FC5
PHP 5.1.4 (cli) (built: May 8 2006 08:41:41)
Apache 2.2.2
Mysql 5.0.22
base-1.2.5
adodb490
jpgraph-2.1.2

(I moved to Base... after Acid gave a very similar
error... Fatal error: Call to undefined method
ProtocolFieldCriteria::protocolfieldcriteria()
in /var/www/html/acid/acid_state_citems.inc on line
979)

Discussion

  • Kevin Johnson
    Kevin Johnson
    2006-07-12

    Logged In: YES
    user_id=836228

    This seems to be a php issue. How was it built? The (cli) is throwing me off....

    Kevin

     
  • Peter
    Peter
    2006-07-13

    Logged In: YES
    user_id=1543189

    I have the same error on a Gentoo Linux box. This is how my
    PHP 5.1.4 was compiled:

    dev-lang/php-5.1.4 USE="apache2 berkdb bzip2 cgi cli crypt
    ctype gd gdbm imap mhash mysql ncurses nls pcre posix
    readline reflection session spell spl sqlite ssl threads
    truetype xml zlib -adabas -apache -bcmath -birdstep
    -calendar -cdb -cjk -curl -curlwrappers -db2 -dbase -dbmaker
    -debug -discard-path -doc -empress -empress-bcs -esoob -exif
    -fastbuild -fdftk -filepro -firebird -flatfile
    -force-cgi-redirect -frontbase -ftp -gd-external -gmp
    -hardenedphp -hash -hyperwave-api -iconv -informix -inifile
    -interbase -iodbc -ipv6 -java-external -kerberos -ldap
    -libedit -mcve -memlimit -ming -msql -mssql -mysqli -oci8
    -oci8-instant-client -odbc -pcntl -pdo -pdo-external -pic
    -postgres -qdbm -recode -sapdb -sasl -sharedext -sharedmem
    -simplexml -snmp -soap -sockets -solid -sybase -sybase-ct
    -sysvipc -tidy -tokenizer -unicode -vm-goto -vm-switch -wddx
    -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip" 0 kB

    (-foo marks an item that is not included)

     
  • ajos1
    ajos1
    2006-07-13

    Logged In: YES
    user_id=1175402

    Interesting one... it is the standard Redhat Fedora Core 5
    Php and subsequent updates from them.

    packages/php-5.1.4-1.i386.rpm
    packages/php-gd-5.1.4-1.i386.rpm
    packages/php-ldap-5.1.4-1.i386.rpm
    packages/php-mbstring-5.1.4-1.i386.rpm
    packages/php-mysql-5.1.4-1.i386.rpm
    packages/php-odbc-5.1.4-1.i386.rpm
    packages/php-pdo-5.1.4-1.i386.rpm
    packages/php-pgsql-5.1.4-1.i386.rpm

    packages/php-pear-1.4.6-2.1.noarch.rpm
    packages/php-pear-1.4.9-1.noarch.rpm

    php -m gets...

    [root@www ~]# php -m
    [PHP Modules]
    bz2
    calendar
    ctype
    curl
    date
    dom
    eAccelerator
    exif
    ftp
    gd
    gettext
    gmp
    hash
    iconv
    imap
    ldap
    libxml
    mbstring
    mcrypt
    mhash
    mime_magic
    mysql
    mysqli
    odbc
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    PDO_ODBC
    pdo_pgsql
    pdo_sqlite
    pgsql
    posix
    pspell
    Reflection
    session
    shmop
    SimpleXML
    soap
    sockets
    SPL
    standard
    sysvmsg
    sysvsem
    sysvshm
    tokenizer
    wddx
    xml
    xmlreader
    xmlwriter
    xsl
    zlib

    [Zend Modules]
    eAccelerator

     
  • ajos1
    ajos1
    2006-07-14

    Logged In: YES
    user_id=1175402

    Okay this is going to sound crazy... but I decided to test
    if my previous theory about a missing function was correct
    or not...

    So in "base/includes/base_state_citems.inc.php" at line
    296... I thought I would stick a dummy function...
    called "ProtocolFieldCriteria()" within the
    Class "ProtocolFieldCriteria" .

    The idea was to see if the original error message
    disappeared or not... and what the next error message would
    be.

    So code segment...

    ======================================
    class ProtocolFieldCriteria extends MultipleElementCriteria
    {
    function SanitizeElement($i)
    {
    ....
    ....
    ======================================

    Became....

    ======================================
    class ProtocolFieldCriteria extends MultipleElementCriteria
    {

    function ProtocolFieldCriteria() {
    return(0);
    }

    function SanitizeElement($i)
    {
    ....
    ....
    ======================================

    Guess what! My system started working!

    Obviously you have sections of code that say:

    parent::ProtocolFieldCriteria()

    with many arguments being passed to it... (ie)... $tdb,
    $cs, $export_name, $element_cnt,

    And I have just created a dummy "function
    ProtocolFieldCriteria()" with no arguments with a "return
    (0)" in it...

    So it is not the final fix... but an indication...

    But I do think... that my previous statements
    about "parent" and the fact there is a missing function in
    the base code might be right... (same with the acid code...
    same error with that).

    What do you think? I hope that this is useful...

     
  • Kevin Johnson
    Kevin Johnson
    2006-07-14

    Logged In: YES
    user_id=836228

    I wonder if this is an issue with 5.1 of PHP. I do not currently have a 5.1 system
    to test with and all of my systems work without this issue? I think you are on
    the right track.

    Thanks for the help,
    Kevin

     
  • ajos1
    ajos1
    2006-07-14

    Logged In: YES
    user_id=1175402

    I think that Php5 has made "Class" code more stricter (ie)
    follows Object Orientated Programming standards much
    closer than in Php4.

    As there are more and more people going over to Php5...
    then there will be more and more people finding this a
    problem.

    I will look at the code in more detail and see if I can
    work out what it is doing... so I can offer a proper
    suggestion.

     
  • garaged
    garaged
    2006-07-19

    Logged In: YES
    user_id=1429811

    I have PHP 5.1.4-0.1 on debian, no poblem to see
    base-php4/base_stat_ports.php?port_type=1&proto=-1

    I think there is something hidden here, are you using
    register_globals=On ??

    If so please trun it off and try again.

     
  • Peter
    Peter
    2006-07-19

    Logged In: YES
    user_id=1543189

    I have register_globals = Off so it must be something else
    that is causing the problem.

     
  • ajos1
    ajos1
    2006-08-08

    Logged In: YES
    user_id=1175402

    C'est moi!

    + I have downloaded 1.2.6 ...
    and
    + I also have made sure that "register_globals = Off"

    The same problem exists... so I have to edit

    /var/www/html/base/includes/base_state_citems.inc.php

    and throw in the empty procedure...

    class ProtocolFieldCriteria extends MultipleElementCriteria
    {
    function ProtocolFieldCriteria() {
    return(0);
    }

     
  • Logged In: NO

    you must be using mod_php4 not mod_php5, please verify that,
    I have no problem like you with mod_php5.

    Notice that you show the CLI version not the one used by apache

     
  • Logged In: NO

    Just checked... Apache says it is 5.1.4... and in the
    modules directory is "libphp5.so"... I will check some
    more.

     
  • Kevin Johnson
    Kevin Johnson
    2006-09-01

    Logged In: YES
    user_id=836228

    I have checked into CVS the fix that you put in below... It does not appear to
    break anything, but since no of the devs can reproduce the problem, I can't
    really say it fixes it either.

    Kevin

     
  • Kevin Johnson
    Kevin Johnson
    2006-09-01

    • status: open --> closed-accepted