solved Beginner - Simple Module

SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
We upload extremely simple module into our "modules" folder, but it crashes the ACP with this error:
-----
Error: Query Error: Incorrect string value: '\xA92017' for column 'module_developer' at row 1
-----
CODE: Most Simple Module - Just send test message to Debug log:
-----
1 FOLDER: sdContestMWUser
-----
1 FILE: INCLUDE.PHP:
-----
<?php
/**
* @copyright 2017 SoftDesigns, Inc.
*/

//Ensure this module not called directly:
defined('APP_DIR') or exit();

/**
 * meta
 */
function sdContestMWUser_meta(){
	$_tmp = array(
			'name'        => 'ContestMWUser',
			'url'         => 'ContestMWUser',
			'version'     => '1.0.0',
			'developer'   => 'SoftDesigns,Inc. ©' . strftime('%Y'),
			'description' => 'Verify Contest User',
			'category'    => 'contest'
	);
	return $_tmp;
}

/**
 * init
 */
function sdContestMWUser_init(){	
	$_args = array(
			'sdKey1' => 'sdValue1',
			'sdKey2' => 'sdValue2'
	);	
	fdebug("sdContestMWUser_init", $_args);
	return true;
}


Please Advise...
updated by @softdesigns: 04/13/17 08:13:19AM
nate
@nate
7 years ago
917 posts
Don't use the @ sign. Use &copy followed by a semi colon and tell me if that fixes it.
updated by @nate: 01/10/17 10:30:49AM
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
It seems had to remove both: @ sign, as well as the © - Now the error is gone.
Thanks...
-----
The sample code in this help article may need to be updated, for others to avoid this bug:
https://www.jamroom.net/the-jamroom-network/documentation/jamroom-developers-guide/26/creating-a-module
-----
Simple Code Below Working Now:
-----
<?php
/**
* 2017 SoftDesigns
*/

//Ensure this module not called directly:
defined('APP_DIR') or exit();

/**
 * meta
 */
function sdContestMWUser_meta(){
	$_tmp = array(
			'name'        => 'ContestMWUser',
			'url'         => 'ContestMWUser',
			'version'     => '1.0.0',
			'developer'   => 'SoftDesigns',
			'description' => 'Verify Contest User',
			'category'    => 'contest'
	);
	return $_tmp;
}

/**
 * init
 */
function sdContestMWUser_init(){	
	$_args = array(
			'sdKey1' => 'sdValue1',
			'sdKey2' => 'sdValue2'
	);	
	//jrCore_logger('sdContestMWUser', 
	//'This is the activity log message', $_array);	
	fdebug("sdContestMWUser_init", $_args);
	return true;
}

updated by @softdesigns: 01/10/17 10:42:49AM
nate
@nate
7 years ago
917 posts
lolI typed @ but you knew what I meant.
nate
@nate
7 years ago
917 posts
If you use
&copy;
You can have copyright included.
updated by @nate: 01/10/17 10:51:18AM
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
Ok - cool - thanks...
BTW : Where can we find these types of custom modules in our ACP?
This one does not seem to show up in any module list.
Usually we would find the module, and need to set module to "active"
We are brand new to try custom module, Did our code miss something?
Please Advise...
updated by @softdesigns: 01/10/17 10:56:59AM
nate
@nate
7 years ago
917 posts
You have it under contest. So you should see a contest category.
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
You are right - that is what I assume also, however I do not find 'contest' category.
I just tried to change the code to 'tools':
'category'    => 'tools'
Still I do not see under tools.
Maybe something in the code is wrong?
I assumed just simply upload the custom module into the "modules" folder.
Is there any other action required in the ACP for a custom module to show in the modules list?
updated by @softdesigns: 01/10/17 11:44:35AM
nate
@nate
7 years ago
917 posts
Delete the module run an integrity check and install the module and run the check again. Make sure you reload the ACP. Then look in tools.
nate
@nate
7 years ago
917 posts
Make sure you use the ACP to delete the module.
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
You are correct - after running 'integrity check' - now custom module shows in list.
Thanks...

Tags