When i enable the module in 5.x or -dev the smileys.install file isnt doing its anything and installing a DB table. Anyone else had this problem?

Comments

awb7422’s picture

I'm having this same problem; would it be possible for someone to tell me what code i would need to run to manually create the table and inport the icons that ship with the package? Thanks very much

awb7422’s picture

I was able to get the table created by editing smileys.install and added the following (which is just a copy of the install function), then ran update.php and selected updated 2:

function smileys_update_2 () {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$result = db_query("CREATE TABLE IF NOT EXISTS {smileys} (
id int(11) auto_increment,
acronyms varchar(255) DEFAULT '' NOT NULL,
image varchar(255) DEFAULT '' NOT NULL,
description varchar(64) DEFAULT '' NOT NULL,
standalone tinyint(1) DEFAULT '0' NOT NULL,
package varchar(64) DEFAULT 'Uncategorized' NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
case 'pgsql':
$result = db_query("CREATE TABLE {smileys} (
id SERIAL,
acronyms varchar(255) DEFAULT '' NOT NULL,
image varchar(255) DEFAULT '' NOT NULL,
description varchar(64) DEFAULT '' NOT NULL,
standalone INT2 NOT NULL DEFAULT '0',
package varchar(64) DEFAULT 'Uncategorized' NOT NULL,
PRIMARY KEY (id)
)");
break;
}
if ($result) {
$dir = drupal_get_path('module', 'smileys'). '/packs/example/';
$examples = array(
array(':) :-) :smile:', 'smile.png', 'Smiling'),
array(';) ;-) :wink:', 'wink.png', 'Eye-wink'),
array(':( :-( :sad:', 'sad.png', 'Sad'),
array(':D :-D :lol:', 'lol.png', 'Laughing out loud'),
array('}:) }:-) :evil:', 'evil.png', 'Evil'),
array(':P :-P :tongue:', 'tongue.png', 'Sticking out tongue'),
array(':O :-O :shocked:', 'shock.png', 'Shocked'),
array(':? :-? :puzzled:', 'puzzled.png', 'Puzzled'),
array('8) 8-) :cool:', 'cool.png', 'Cool'),
array(':jawdrop:', 'jawdrop.gif', 'Jawdropping!'),
array(':sick: :barf:', 'barf.gif', 'Barf!'),
);
foreach ($examples as $data) {
db_query("INSERT INTO {smileys} (acronyms, image, description, standalone, package) VALUES ('%s', '%s', '%s', 1, '%s');", $data[0], $dir . $data[1], $data[2], 'example');
}
}
}

rkn-dupe’s picture

Think we made it work by using phpmyadmin directly

Gurpartap Singh’s picture

Status: Active » Postponed (maintainer needs more info)

Did you already had smileys tables in your database (in case you upgraded your sites from 4.7 to 5.x)? If not, then this is unexpected behavior. Haven't been able to reproduce this yet. Will mark closed if it comes to no go.

rkn-dupe’s picture

Yes we already had the tables as we had done the drupal upgrade :)

Gurpartap Singh’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

4.7.x to 5.x upgrade support has ceased for this module. Still if anyone is stuck with it, I would suggest you to remove the table smileys from your database and install a fresh copy of smileys for Drupal 5 or 6.