Skip to content

Commit

Permalink
Fixed issue #12059: Internal Server Error Property 'UniqueNotificatio…
Browse files Browse the repository at this point in the history
…n.hash' is not defined
  • Loading branch information
olleharstedt committed Jan 16, 2017
1 parent d104a79 commit 9fd7f17
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -13,7 +13,7 @@
*/

$config['versionnumber'] = '2.59.0';
$config['dbversionnumber'] = 260;
$config['dbversionnumber'] = 261;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['assetsversionnumber'] = '2590';
Expand Down
15 changes: 14 additions & 1 deletion application/helpers/update/updatedb_helper.php
Expand Up @@ -1438,11 +1438,24 @@ function db_upgrade_all($iOldDBVersion, $bSilent=false) {
alterColumn('{{participant_attribute_names_lang}}','attribute_name',"string(255)",false);
$oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>260),"stg_name='DBVersion'");
}

/*
* The hash value of a notification is used to calculate uniqueness.
* @since 2016-08-10
* @author Olle Haerstedt
*/
if ($iOldDBVersion < 261) {
addColumn('{{notifications}}', 'hash', 'string(64)');
$oDB->createCommand()->createIndex('notif_hash_index', '{{notifications}}', 'hash', false);

$oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>262),"stg_name='DBVersion'");
}

// Inform superadmin about update
$superadmins = User::model()->getSuperAdmins();
Notification::broadcast(array(
'title' => gT('Database update'),
'message' => sprintf(gT('The database has been updated from version %s to version %s.'), $iOldDBVersion, '260')
'message' => sprintf(gT('The database has been updated from version %s to version %s.'), $iOldDBVersion, '261')
), $superadmins);


Expand Down

3 comments on commit 9fd7f17

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olleharstedt : $iOldDBVersion < 261 : ok then apply now for 260, not for 261.

But $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>262),"stg_name='DBVersion'"); then after the update DB version is at 262 .

Need to update file version too ? Without any update , no ?

@olleharstedt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check next commit, it should be set to 261.

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next not happen now ?

Because : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/config/version.php#L16
OIt's not really an issue, just quickly fix to 262 in version (and doing nothing when update from a 261 : just update the DBversion)

capture du 2017-01-25 13-48-37

Please sign in to comment.