Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Pro

 AfterLogic Forum : AfterLogic WebMail Pro
Subject Topic: 8.5.3 needs table update; didn’t know Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
tigertech
Newbie
Newbie


Joined: 21 November 2019
Online Status: Offline
Posts: 23
Posted: 27 January 2021 at 11:51am | IP Logged Quote tigertech

Since upgrading from 8.5.2 to 8.5.3, I've noticed problems with signatures not being saved or used. I tracked this down to a change in where the signatures are stored:


--- webmail-pro-8.5.2/modules/Mail/Classes/Identity.php 2020-10-30 04:16:37.000000000 -0700
+++ webmail-pro-8.5.3/modules/Mail/Classes/Identity.php 2020-12-22 06:11:10.000000000 -0800
@@ -32,6 +32,6 @@
               'Email'                 => array('string', ''),
               'FriendlyName' => array('string', '', true),
               'UseSignature' => array('bool', false),
-               'Signature'             => array('text', ''),
+               'Signature'             => array('mediumblob', ''),
        );


There's code in 8.5.3 to automatically move the existing signatures from the old database table to the new, but it only gets run when you login as a superadmin and click the "Create/Update Tables" button, which I didn't realize was necessary for minor updates. Doing that solved the problem.

As a suggestion, the CHANGELOG.txt should specifically mention when a table update is needed. Or, even better, the code should store a value in a database table that says what "version" of database tables have been updated, and check it on each login, then apply the table updates automatically if it's outdated. (This is the way WordPress works, for example.)

Thanks!
Back to Top View tigertech's Profile Search for other posts by tigertech
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 27 January 2021 at 5:35pm | IP Logged Quote Igor

Actually, WebMail Pro upgrading instructions specifically mention that database update as well as updating configuration is required on any upgrade.

We will consider the suggestion of course, though it only looks feasible when you upgrade from the directly preceeding version which isn't necessarily the case.

--
Regards,
Igor, Afterlogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
tigertech
Newbie
Newbie


Joined: 21 November 2019
Online Status: Offline
Posts: 23
Posted: 28 January 2021 at 10:49am | IP Logged Quote tigertech

Igor wrote:
Actually, WebMail Pro upgrading instructions specifically mention that database update as well as updating configuration is required on any upgrade.


Yep, it was definitely my fault for misreading the instructions; for some reason I thought those were only necessary when doing a more major upgrade. But I would guess that table changes happen so infrequently that adding a quick reminder to the changelog in such a case might avoid support requests from people like me


Igor wrote:
We will consider the suggestion of course, though it only looks feasible when you upgrade from the directly preceeding version which isn't necessarily the case.


Well, the way it's done is something like:


$tableversion = GetTableVersionFromDatabase();
if ($tableversion < 2) {
MakeTableVersion2Changes();
StoreTableVersionInDatabase(2);
}
if ($tableversion < 3) {
MakeTableVersion3Changes();
StoreTableVersionInDatabase(3);
}
if ($tableversion < 4) {
MakeTableVersion4Changes();
StoreTableVersionInDatabase(4);
}


That way the code can apply whichever changes are necessary, and you just add new changes to the end. But I suppose then you need locking to prevent more than one copy of this running at the same time, and so on, so it's not really this simple....
Back to Top View tigertech's Profile Search for other posts by tigertech
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide