Mysql error trying to use UMIL permission_set

Discussion forum for MOD Writers regarding MOD Development.
Locked
wired076
Registered User
Posts: 1441
Joined: Mon May 21, 2007 10:19 am

Mysql error trying to use UMIL permission_set

Post by wired076 » Mon Jun 13, 2011 1:29 am

Hi All,

As per a suggestion from the kind mod validation team I am trying to add permissions automatically to the ROLE_FORUM_FULL however I receive the following error:

Code: Select all

General Error
SQL ERROR [ mysql4 ]

[0]

SQL

No values specified for SQL IN comparison

BACKTRACE

FILE: includes/db/dbal.php
LINE: 379
CALL: dbal->sql_error()

FILE: umil/umil.php
LINE: 1824
CALL: dbal->sql_in_set()

FILE:
LINE:
CALL: umil->permission_set()

FILE: umil/umil.php
LINE: 388
CALL: call_user_func()

FILE: umil/umil_auto.php
LINE: 179
CALL: umil->run_actions()

FILE: install/index.php
LINE: 152
CALL: include('umil/umil_auto.php')

Please notify the board administrator or webmaster: admin@itconstruct.com.au
When I try and run the UMIL Install script.

Please note that the install script does work fine without permission_set however once I have added this in I start to get issues with the script not wanting to run.

Please find the specific lines that are causing this problem below:

Code: Select all

	'1.0.4'   => array(
		'permission_set' => 'ROLE_FORUM_FULL', 
			array('f_xam_register', 'f_xam_create', 'f_xam_preset'),
	),
Full install/index.php file if needed:

Code: Select all

<?php

/**
*
* @package - AM Attendance Mod
* @version $Id: index.php 92 2011-01-14 16:20:42Z wired076 $
* @copyright (c) wired076 ( http://www.itconstruct.com.au/ ) 
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
define('UMIL_AUTO', true);
define('IN_PHPBB', true);
define('IN_INSTALL', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

$user->session_begin();
$auth->acl($user->data);
$user->setup();
$user->add_lang('acp/common');
$new_mod_version = '0.2.0';
$page_title = 'Attendance Mod, Version' . $new_mod_version;

$am_module_array = array();

if (!file_exists($phpbb_root_path . 'umil/umil_auto.' . $phpEx))
{
   trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
}
$mod_name = 'TITLE';
$version_config_name = 'am_mod_version';
$language_file = 'mods/info_am_presets';

$versions = array(
   // Version 0.2.9
   '0.2.9'   => array(
		'config_add' => array(
			array('am_number', 5),
			array('am_page_number', 0),
			array('am_anti_topics', 0),
			array('am_index', 1),
		),
		'module_add' => array(
			array('acp', 'ACP_CAT_DOT_MODS', 'ATTENDANCE MOD'),

			array('acp', 'ATTENDANCE MOD', array(
				'module_basename'	=> 'am_presets',
				'module_enabled'	=> 1,
				'module_display'	=> 1,
				'parent_id'         => 'module_id',
				'module_class'      => 'acp',
				'module_langname'   => 'ACP_AM_PRESETS',
				'module_mode'		=> 'presets',
				'module_auth'		=> ''
			),),
		),
		'table_add' => array(
			array('phpbb_am_options', array(
				'COLUMNS' => array(
					'am_option_id'		=> array('UINT', NULL, 'auto_increment'),
					'topic_id'			=> array('UINT', 0),
					'am_option_text'	=> array('TEXT', ''),
					'am_option_max'		=> array('BOOL', '0'),
					'am_option_color'	=> array('VCHAR:6', '000000'),
				),
				'PRIMARY_KEY'	=> 'am_option_id',
				'KEYS'	=> array(
					'am_topic_id'	=> array('INDEX', array('topic_id')),
				),
			)),

			array('phpbb_am_registrations', array(
				'COLUMNS'	=> array(
					'am_registration_id'		=> array('UINT', NULL, 'auto_increment'),
					'topic_id'					=> array('UINT', 0),
					'am_option_id'				=> array('UINT', 0),
					'am_user_id'				=> array('UINT', 0),
					'am_user_ip'				=> array('VCHAR:40', '0'),
					'am_registration_time'		=> array('INT:11', 0),
					'am_registration_confirmed'	=> array('INT:11', 0),
				),
				'PRIMARY_KEY'	=> 'am_registration_id',

				'KEYS'	=> array(
					'am_option_id'	=> array('INDEX', array('am_option_id', 'am_user_id', 'topic_id')),
				),
			)),

			array('phpbb_am_presets', array(
				'COLUMNS'	=> array(
					'am_preset_id'		=> array('UINT', NULL, 'auto_increment'),
					'am_preset_name'	=> array('VCHAR:50', '0'),
					'am_length'			=> array('INT:11', 0),
					'am_visible'		=> array('TINT:1', 0),
					'am_confirmable' 	=> array('TINT:1', 0),
					'am_reg_change' 	=> array('TINT:1', 0),
					'am_layout' 		=> array('TINT:2', 0),
					'am_option_text' 	=> array('TEXT', ''),
					'am_option_max' 	=> array('TEXT', ''),
					'am_option_color'	=> array('TEXT', ''),
					'am_preset_order'	=> array('UINT', 0),
				),

				'PRIMARY_KEY'	=> 'am_preset_id',
			)),

		),
		 
		'table_column_add'	=> array(
			array('phpbb_topics', 'am_start', array('INT:11', 0)),
			array('phpbb_topics', 'am_length', array('INT:11', 0)),
			array('phpbb_topics', 'am_visible', array('TINT:1', 0)),
			array('phpbb_topics', 'am_confirmable', array('TINT:1', 0)),
			array('phpbb_topics', 'am_reg_change', array('TINT:1', 0)),
			array('phpbb_topics', 'am_layout', array('TINT:2', 0)),
		),
		'permission_add' => array(
			'am_permissions',
			array('f_xam_register', false),
			array('f_xam_create', false),
			array('f_xam_preset', false),
		),
	
	),
	// Version 0.2.10
	'0.2.10' => array(),
	// Version 0.3.1
	'0.3.1'	=> array(),
	// Version 0.3.2
	'0.3.2'	=> array(),
	// Version 1.0.0
	'1.0.0'	=> array(),
	// Version 1.0.1
	'1.0.1'	=> array(),
	// Version 1.0.2
	'1.0.2'	=> array(),
	//Version 1.0.3
	'1.0.3' => array(),
	// Version 1.0.4
	'1.0.4'   => array(
		'permission_set' => 'ROLE_FORUM_FULL', 
			array('f_xam_register', 'f_xam_create', 'f_xam_preset'),
	),
);
	
// Include the UMIL Auto file and everything else will be handled automatically.
include($phpbb_root_path . 'umil/umil_auto.' . $phpEx);
$cache->purge();
?>
I have looked at the Wiki on the UMIL permission set page however I am still unsure on what I am doing wrong.

If someone is able to please have a look at my code and help me to resolve this problem it would be greatly appreciated!

User avatar
Sajaki
Registered User
Posts: 1354
Joined: Mon Mar 02, 2009 1:41 pm
Name: Andreas
Contact:

Re: Mysql error trying to use UMIL permission_set

Post by Sajaki » Mon Jun 13, 2011 3:08 pm

Code: Select all

       '1.0.4'   => array(
    'permission_set' => array(
        array => ( 'ROLE_FORUM_FULL', 'f_xam_register'), 
        array => ( 'ROLE_FORUM_FULL', 'f_xam_create'), 
        array => ( 'ROLE_FORUM_FULL', 'f_xam_preset')
       ),
like this : https://github.com/bbDKP/bbDKP/blob/dev ... x.php#L547

wired076
Registered User
Posts: 1441
Joined: Mon May 21, 2007 10:19 am

Re: Mysql error trying to use UMIL permission_set

Post by wired076 » Tue Jun 14, 2011 2:40 am

Sajaki wrote:

Code: Select all

       '1.0.4'   => array(
    'permission_set' => array(
        array => ( 'ROLE_FORUM_FULL', 'f_xam_register'), 
        array => ( 'ROLE_FORUM_FULL', 'f_xam_create'), 
        array => ( 'ROLE_FORUM_FULL', 'f_xam_preset')
       ),
like this : https://github.com/bbDKP/bbDKP/blob/dev ... x.php#L547
Thank you Sajaki that is what I needed.

However the final code for anyone else that encounters a similar problem to this is:(working code block)

Code: Select all

	'1.0.4'   => array(
		'permission_set' => array(
			array('ROLE_FORUM_FULL', 'f_xam_register'),
			array('ROLE_FORUM_FULL', 'f_xam_create'),
			array('ROLE_FORUM_FULL', 'f_xam_preset')
		),
	),

Locked

Return to “[3.0.x] MOD Writers Discussion”