Bug 3624 - Basket group delivery place
Summary: Basket group delivery place
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Ian Walls
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-14 04:06 UTC by Paul Poulain
Modified: 2012-10-25 23:09 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
feature add (124.38 KB, patch)
2009-11-01 13:11 UTC, Chris Cormack
Details | Diff | Splinter Review
Proposed patch for kohastructure.sql (1.13 KB, patch)
2010-12-01 15:37 UTC, Fridolin Somers
Details | Diff | Splinter Review
Proposed patch for Template XHTML validity (1.95 KB, patch)
2010-12-01 15:43 UTC, Fridolin Somers
Details | Diff | Splinter Review
Proposed patch for kohastructure.sql rewritten (1.03 KB, patch)
2011-03-01 10:43 UTC, Paul Poulain
Details | Diff | Splinter Review
Bug 3624 : XHTML validation, rebased for Template Toolkit (1.79 KB, patch)
2011-07-07 21:44 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:13:00 UTC


---- Reported by paul.poulain@biblibre.com 2009-09-14 16:06:36 ----

The delivery place (selected from branches list) should be selected basketgroup by basketgroup (not mandatory)
add a free text field to specify the delivery details (even if a branch has been selected)



---- Additional Comments From jeanandre.santoni@biblibre.com 2009-11-01 13:11:03 ----

Created an attachment
feature add





--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:13 UTC  ---

This bug was previously known as _bug_ 3624 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3624
Imported an attachment (id=1469)

Actual time not defined. Setting to 0.0
CC member jeanandre.santoni@biblibre.com does not have an account here
The original submitter of attachment 1469 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.

Comment 1 Owen Leonard 2010-06-28 16:47:22 UTC
This feature seems to have made it into HEAD.
Comment 2 Fridolin Somers 2010-12-01 15:35:49 UTC
Hie,

I have to reopen this bug because an essential part is missing : the modification of kohastructure.sql.

I have installed a new database with 3.2.0 version and the basket group saving didn't work. So I found that fields "deliveryplace", "deliverycomment" and "billingplace" where missing in "aqbasquetgroups" table.

See proposed patch.

Regards,
Comment 3 Fridolin Somers 2010-12-01 15:37:13 UTC Comment hidden (obsolete)
Comment 4 Fridolin Somers 2010-12-01 15:43:03 UTC Comment hidden (obsolete)
Comment 6 Paul Poulain 2011-03-01 10:36:21 UTC
Fridolyn, unless i'm mistaken, you haven't updated your patch.

Marquing this as BLO, as the DB structure is invalid and acq don't work anymore
Comment 7 Paul Poulain 2011-03-01 10:43:33 UTC Comment hidden (obsolete)
Comment 8 Nicole C. Engard 2011-03-07 18:14:04 UTC
Signed off on the patch, but I have a question.  For new installs who didn't have this should there also be a follow up to add these fields in an upgrade if they're missing?  I mention this because I have a new install without those fields and I won't get them unless I add them in manually.
Comment 9 Chris Cormack 2011-03-07 20:33:57 UTC
Yes there should be Nicole, Ill do a follow up patch for that.
Comment 10 Chris Cormack 2011-03-11 19:26:31 UTC
Pushed, please test and mark resolved
Comment 11 Julian Maurice 2011-04-01 08:56:30 UTC
Why did the patch for xhtml validity not been pushed?
Comment 12 Francois Charbonnier 2011-04-06 12:49:33 UTC
I tested this patch. 

It works but i noticed that the billing place isnt saved if you dont select a lirary in the drop-down list box. Is it a side effect? Do i open up a new bug?

I also did selenium tests with the firefox addon. If anyone want these to replay the tests I did, let me know.
Comment 13 Katrin Fischer 2011-07-07 21:25:53 UTC
Patch for xhtml validity needs to be redone for TT.
Checked problem still exists in this template on master.
Comment 14 Chris Cormack 2011-07-07 21:44:43 UTC Comment hidden (obsolete)
Comment 15 Chris Cormack 2011-07-07 21:46:17 UTC
All that is remaining is the xhtml fix, patch attached
Comment 16 Ian Walls 2011-07-19 20:37:07 UTC
On two recently updated installations, I've seen the deliveryplace, deliverycomment, and billingplace columns fail to be inserted into the table by updatedatabase.pl.  Can anyone else confirm that upgrading from pre-3.03.00.023 to current HEAD fails to update the database appropriately, or is this a local problem for me?
Comment 17 Paul Poulain 2011-07-21 10:49:52 UTC
an idea :
The deliveryplace & deliverycomment are added in 3.01.00.0094
and the 03.00.0023 does a test/check :
my $sth = $dbh->prepare("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'aqbasketgroups' AND COLUMN_NAME = 'billingplace'");
$sth->execute;
$dbh->do("ALTER TABLE aqbasketgroups ADD billingplace VARCHAR(10)") if ! $sth->fetchrow_hashref;

maybe there is something wrong with this check and the ALTER TABLE is not done.
Do you have a backup with what you had before the update ?
Comment 18 Ian Walls 2011-07-25 15:33:46 UTC
Paul,


That seems likely; I'll try pulling an older-version update, and checking the update process.
Comment 19 Paul Poulain 2011-08-02 14:04:30 UTC
ian, once you have more details, give me the bug back, or close if no more relevant
Comment 20 Katrin Fischer 2011-09-18 20:06:31 UTC
The attached patch introduces translation problems (bug 6458). Problem was fixed by http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5131
Removing needs sign-off.
Comment 21 Paul Poulain 2011-09-26 15:51:29 UTC
Owen, it's unclear for me why you've removed the "patch sent". Could you give more details pls ?
Comment 22 Ian Walls 2011-09-26 15:59:10 UTC
Paul,

There is no non-obsolete patch attached, so it was decided in IRC to remove the patch-sent status until we could get more information.  Is there a pending patch that needs signoff or QA?
Comment 23 Katrin Fischer 2011-10-28 16:30:30 UTC
Ok, I have looked into this:

NEW INSTALLATIONS 
kohastructure.sql seems correct now. I also checked a new database, all fields are there.

DROP TABLE IF EXISTS `aqbasketgroups`;
CREATE TABLE `aqbasketgroups` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(50) default NULL,
  `closed` tinyint(1) default NULL,
  `booksellerid` int(11) NOT NULL,
  `deliveryplace` varchar(10) default NULL,
  `freedeliveryplace` text default NULL,
  `deliverycomment` varchar(255) default NULL,
  `billingplace` varchar(10) default NULL,
  PRIMARY KEY  (`id`),
  KEY `booksellerid` (`booksellerid`),
  CONSTRAINT `aqbasketgroups_ibfk_1` FOREIGN KEY (`booksellerid`) REFERENCES `aqbooksellers` (`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

UPDATED INSTALLATIONS
Installations updating from a version number below 3.01.00.94 should be ok. I checked the sql statements are correct.
First update in updatedatabase.pl:
$DBversion = "3.01.00.094";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
$dbh->do(qq{ALTER TABLE aqbasketgroups ADD deliveryplace VARCHAR(10) default NULL, ADD deliverycomment VARCHAR(255) default NULL;});

$DBversion = "3.01.00.097";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
$dbh->do(qq{ALTER TABLE aqbasketgroups ADD billingplace VARCHAR(10) NOT NULL AFTER deliverycomment;});

NEW INSTALLATIONS CREATED WHILE FIELDS WHERE MISSING
I have removed the 3 columns from my database and added the code below as 3.06.00.001 to my updatedatabase. The updatedatabase reported no errors, but the columns were NOT added to my databse. 

$DBversion = '3.03.00.023';
I created a branch for an old version of Koha (3.02.04.000) and recreated my database from scratch. The 3 columns are missing from aqbasketgroups. I checked out back to master and ran the web installer. Got some complaints about privacy and:

Upgrade to 3.03.00.023 done (Reconcile aqbasketgroups)
Confirmed that columns were correctly added to the datebase.

if (C4::Context->preference("Version") < TransformToNum($DBversion) && $original_version < TransformToNum("3.02.05.002")) {
    my $sth = $dbh->prepare("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'aqbasketgroups' AND COLUMN_NAME = 'billingplace'");
    $sth->execute;
    $dbh->do("ALTER TABLE aqbasketgroups ADD billingplace VARCHAR(10)") if ! $sth->fetchrow_hashref;
    $sth = $dbh->prepare("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'aqbasketgroups' AND COLUMN_NAME = 'deliveryplace'");
    $sth->execute;
    $dbh->do("ALTER TABLE aqbasketgroups ADD deliveryplace VARCHAR(10)") if ! $sth->fetchrow_hashref;
    $sth = $dbh->prepare("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'aqbasketgroups' AND COLUMN_NAME = 'deliverycomment'");
    $sth->execute;
    $dbh->do("ALTER TABLE aqbasketgroups ADD deliverycomment VARCHAR(255)") if ! $sth->fetchrow_hashref;
    print "Upgrade to $DBversion done (Reconcile aqbasketgroups)\n";
    SetVersion ($DBversion);
}

XHTML VALIDITY
Checked on current master. Ok.

I am marking this closed, please reopen if I missed something.
Comment 24 Katrin Fischer 2011-10-28 16:32:14 UTC
Ok, some things got mixed up down here:

"NEW INSTALLATIONS CREATED WHILE FIELDS WHERE MISSING
I have removed the 3 columns from my database and added the code below as
3.06.00.001 to my updatedatabase. The updatedatabase reported no errors, but
the columns were NOT added to my database"

This didn't work, because the database update was also checking for the version number - so I went back and created a real old database to test it correctly.
And this WORKED. :)