[Solved]: Fatal Error in mod since upgrade 1.4.16 [Solved]: Fatal Error in mod since upgrade 1.4.16
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[Solved]: Fatal Error in mod since upgrade 1.4.16

Started by Halfhidden, March 12, 2008, 04:46:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Halfhidden

Hi Everyone,
I'm busy putting a couple of mods back into play since the upgrade. I'm having fun and games with the Moderators mod by Abbas Ali (http://forum.coppermine-gallery.net/index.php/topic,26218.0.html)
Once the files from this mod have been uploaded to their respective folders (root, lang and includes) I get a fatal Error message (nothing more than the words fatal error:) whilst viewing the site in IE7.0.530. The same message is true when viewing the site in Opera Version 9.26 and Netscape Navigator 9.0.06. However Firefox 2.0.0.12 isn't affected by this and happily surfs away.
I've tracked this down to the init.inc.php file. I replaced it with a file I took as backup before the change and the site was restored when the init.inc.php file was replaced with the original. I know that Nibbler has worked on this file and I believe I placed the code change in the correct line. But obviously It's gone Pete Tong somewhere.
Regards,
Steff

Nibbler

Enable debug mode to see the db error message and a diff viewer to see what the code change is in include/init.inc.php

Halfhidden

Hi Nibbler,
I enabled debug and got the same error from the browsers that were troubled (firefox worked well)

While executing query "SELECT DISTINCT(aid) FROM cpg14x_albums WHERE moderator_group IN (3)" on 0

mySQL error: Unknown column 'moderator_group' in 'where clause'

I think looking at the error message that the table querry didn't create the new Moderators table or alter the cpg14x_albums table am I correct?

Here's the debug from the Coppermine site:

USER:
------------------
Array
(
    [ID] => 32959ce8801dec5bd74eab4453b86834
    [am] => 1
    [lang] => english
    [liv] => Array
        (
           
  • => 960
                [1] => 962
                [2] => 961
                [3] => 963
                [4] => 707
            )

        [search] => Array
            (
                [search] => cinema
                [album] => search
                [title] => on
                [newer_than] =>
                [caption] => on
                [older_than] =>
                [keywords] => on
                [type] => AND
                [params] => Array
                    (
                        [title] => on
                        [caption] => on
                        [keywords] => on
                    )

            )

        [lap] => 2
    )

    ==========================
    USER DATA:
    ------------------
    Array
    (
        [user_id] => 2
        [user_name] => Halfhidden
        [group_name] => Administrators
        [groups] => Array
            (
               
  • => 2
                [1] => 1
            )

        [disk_max] => 0
        [disk_min] => 0
        [can_rate_pictures] => 1
        [can_send_ecards] => 1
        [ufc_max] => 1
        [ufc_min] => 1
        [custom_user_upload] => 0
        [num_file_upload] => 5
        [num_URI_upload] => 0
        [can_post_comments] => 1
        [can_upload_pictures] => 1
        [can_create_albums] => 1
        [has_admin_access] => 1
        [pub_upl_need_approval] => 0
        [priv_upl_need_approval] => 0
        [upload_form_config] => 1
        [group_quota] => 0
        [can_see_all_albums] => 1
        [group_id] => 1
    )

    ==========================
    Queries:
    ------------------
    Array
    (
       
  • => SELECT extension, mime, content, player FROM cpg14x_filetypes; (0s)
        [1] => select * from cpg14x_plugins order by priority asc; (0s)
        [2] => SELECT * FROM cpg14x_bridge (0s)
        [3] => SELECT
             config_name,
             config_value
          FROM
             `picturep_sr0872181`.phpbb_config
          WHERE
             config_name IN ('cookie_name', 'session_length', 'allow_autologin', 'max_autologin_time') (0.003s)
        [4] => SELECT
                   u.*, s.*
                FROM
                   `picturep_sr0872181`.phpbb_users u,
                   `picturep_sr0872181`.phpbb_sessions s
                WHERE
                   u.user_id = s.session_user_id AND
                   u.user_type != 2 AND
                   u.user_type != 1 AND
                   s.session_id = 'f45c4e8675a04307274aee720274b1fa' (0.001s)
        [5] => SELECT
                *
             FROM
                `picturep_sr0872181`.phpbb_user_group ug,
                `picturep_sr0872181`.phpbb_acl_groups ag,
                `picturep_sr0872181`.phpbb_acl_roles_data ard,
                `picturep_sr0872181`.phpbb_acl_options ao
             WHERE
                ug.user_id = 2 AND
                ug.group_id = ag.group_id AND
                ag.auth_role_id = ard.role_id AND
                ard.auth_setting = 1 AND
                ard.auth_option_id = ao.auth_option_id AND
                (ao.auth_option = 'a_cpgadmin' OR ao.auth_option = 'm_cpgadmin') (0s)
        [6] => SELECT
                   *
                FROM
                   `picturep_sr0872181`.phpbb_user_group ug,
                   `picturep_sr0872181`.phpbb_acl_groups ag,
                   `picturep_sr0872181`.phpbb_acl_options ao
                WHERE
                   ug.user_id = 2 AND
                   ug.group_id = ag.group_id AND
                   ag.auth_option_id = ao.auth_option_id AND
                   ag.auth_setting = 1 AND
                   (ao.auth_option = 'a_cpgadmin' OR ao.auth_option = 'm_cpgadmin') (0s)
        [7] => SELECT
               group_name
            FROM
               `picturep_sr0872181`.phpbb_groups
            WHERE
               group_id = 5 (0s)
        [8] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg14x_usergroups WHERE group_id in (2,1) (0s)
        [9] => SELECT group_name FROM  cpg14x_usergroups WHERE group_id= 1 (0s)
        [10] => UPDATE
                   `picturep_sr0872181`.phpbb_sessions
                SET
                    session_time = 1205344085
                WHERE
                   session_id = '' (0s)
        [11] => SELECT user_favpics FROM cpg14x_favpics WHERE user_id = 2 (0.001s)
        [12] => SELECT * FROM cpg14x_plugin_rcmenu order by id (0s)
        [13] => DELETE FROM cpg14x_banned WHERE expiry < '2008-03-12 17:48:05' (0s)
        [14] => SELECT * FROM cpg14x_banned WHERE (ip_addr='87.127.196.17' OR ip_addr='87.127.196.17' OR user_id=2) AND brute_force=0 (0s)
        [15] => SELECT DISTINCT aid, title, IF(category = 0, CONCAT('> ', title), CONCAT(name,' < ',title)) AS cat_title FROM cpg14x_albums, cpg14x_categories WHERE category < '10000' AND (category = 0 OR category = cid) ORDER BY cat_title (0s)
        [16] => SELECT aid, title FROM cpg14x_albums WHERE category='10002'  OR category='10002' ORDER BY title (0s)
        [17] => SELECT category, filepath, filename, owner_id FROM cpg14x_pictures, cpg14x_albums WHERE cpg14x_pictures.aid = cpg14x_albums.aid AND pid='1446' (0.001s)
        [18] => UPDATE cpg14x_pictures SET aid = '182', title = 'Sabers (twang !!)', caption = 'So, here they are, The Sabers. 1963. Malcolm Jackson (lead), John MacDonald (Mac on drums), Chris (bass), Gerald (rhythm) and Henry VIII (vocals); James
    Bennett (stage manager kneeling). Red ties were the in thing but Henry (centre) preferred his silver tie. So many songs were released we had to work out the music, chords and words by ear, or spend a fortune on sheet music (Top of the Pops was based on sheet music sales). Good, live music, all week; bands everywhere, and major visiting bands. The Place was Alive.', keywords = '', user1 = '', user2 = '', user3 = '', user4 = '', approved = 'YES' WHERE pid='1446' LIMIT 1 (0s)
        [19] => SELECT count(*) FROM cpg14x_pictures WHERE approved = 'NO' (0s)
        [20] => SELECT pid, owner_id FROM cpg14x_pictures WHERE owner_id != 0 AND owner_name = '' (0s)
        [21] => SELECT * FROM cpg14x_pictures WHERE approved = 'NO' ORDER BY pid LIMIT 0, 25 (0s)
        [22] => SELECT COUNT(*) FROM cpg14x_pictures WHERE approved = 'NO' (0s)
    )

    ==========================
    GET :
    ------------------
    Array
    (
        [mode] => upload_approval
        [start] => 0
        [count] => 25
    )

    ==========================
    POST :
    ------------------
    Array
    (
        [count] => 25
        [pid] => Array
            (
               
  • => 1446
            )

        [aid1446] => 182
        [title1446] => Sabers (twang !!)
        [caption1446] => So, here they are, The Sabers. 1963. Malcolm Jackson (lead), John MacDonald (Mac on drums), Chris (bass), Gerald (rhythm) and Henry VIII (vocals); James
    Bennett (stage manager kneeling). Red ties were the in thing but Henry (centre) preferred his silver tie. So many songs were released we had to work out the music, chords and words by ear, or spend a fortune on sheet music (Top of the Pops was based on sheet music sales). Good, live music, all week; bands everywhere, and major visiting bands. The Place was Alive.
        [keywords1446] =>
        [user11446] =>
        [user21446] =>
        [user31446] =>
        [user41446] =>
        [approved1446] => YES
    )

    ==========================
    VERSION INFO :
    ------------------
    PHP version: 4.4.4 - OK
    ------------------
    mySQL version: 4.1.22-standard
    ------------------
    Coppermine version: 1.4.16(stable)
    ==========================
    Module: GD
    ------------------
    GD Version: bundled (2.0.28 compatible)
    FreeType Support: 1
    FreeType Linkage: with freetype
    T1Lib Support:
    GIF Read Support: 1
    GIF Create Support: 1
    JPG Support: 1
    PNG Support: 1
    WBMP Support: 1
    XBM Support: 1
    JIS-mapped Japanese Font Support:

    ==========================
    Module: mysql
    ------------------
    MySQL Supportenabled
    Active Persistent Links 0
    Active Links 1
    Client API version 4.1.22
    MYSQL_MODULE_TYPE external
    MYSQL_SOCKET /var/lib/mysql/mysql.sock
    MYSQL_INCLUDE -I/usr/include/mysql
    MYSQL_LIBS -L/usr/lib -lmysqlclient 
    ==========================
    Module: zlib
    ------------------
    ZLib Support enabled
    Compiled Version 1.2.3
    Linked Version 1.2.3
    ==========================
    Server restrictions (safe mode)?
    ------------------
    Directive | Local Value | Master Value
    safe_mode | Off | Off
    safe_mode_exec_dir | no value | no value
    safe_mode_gid | Off | Off
    safe_mode_include_dir | no value | no value
    safe_mode_exec_dir | no value | no value
    sql.safe_mode | Off | Off
    disable_functions | dl | dl
    file_uploads | On | On
    include_path | .:/usr/lib/php:/usr/local/lib/php | .:/usr/lib/php:/usr/local/lib/php
    open_basedir | no value | no value
    ==========================
    email
    ------------------
    Directive | Local Value | Master Value
    sendmail_from | no value | no value
    sendmail_path | /usr/sbin/sendmail -t -i | /usr/sbin/sendmail -t -i
    SMTP | localhost | localhost
    smtp_port | 25 | 25
    ==========================
    Size and Time
    ------------------
    Directive | Local Value | Master Value
    max_execution_time | 30 | 30
    max_input_time | 60 | 60
    upload_max_filesize | 10M | 10M
    post_max_size | 8M | 8M
    ==========================
    Page generated in 0.089 seconds - 23 queries in 0.006 seconds - Album set : ; Meta set: ;


    Regards,
    Steff

Nibbler

Yeah, the field is missing on the albums table.

Halfhidden

Thanks for the quick reply, I'll try to run the query again in myphp admin. and post the results.
Regards,
Steff

Halfhidden

Ok. I looked and indeed the table isn't in the database. So I ran a query on my coppermine database with the following string

ALTER TABLE `cpg14x_albums` ADD `moderator_group` INT NOT NULL;

hit the submit query and nothing happened no table created. Is this normal behaviour for myphp admin? or should I try this query using some other way.
Regards,
Steff

Halfhidden

Hi Nibbler, this has now been fixed. Turned out that table query on my sql has been experiencing problems and the database has just been moved to a new sql server. Ran the query and the table was created. Initial indications shows that the mod will work now. Thanks for your help again.
regards,
Steff
PS wicked work on 1.5 (I like it alot!)