View Issue Details

IDProjectCategoryView StatusLast Update
0015285phplist applicationSubscribe Processpublic13-11-14 12:41
Reporterh2b2 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.10.10 
Target Version2.10.11Fixed in Version2.10.11 
Summary0015285: v2.10.10: Attributes' order of listing on subscribe page cannot be saved
DescriptionWhen changing the order of listing on the 'edit a subscribe page' (lists/admin/?page=spageedit&id=1) by entering numbers starting from 0 in the attribute's "Order of Listing:" fields, and clicking on either the 'Save changes' or 'Save and activate' buttons, the entered values blank out and nothing is changed on the subscribe page.
Additional InformationIssue reported by spidersilk: http://forums.phplist.com/viewtopic.php?p=61874#p61874

Confirmed on my system:
 phplist 2.10.9
 Linux/Apache
 PHP 5.2.3
 MySQL 4.1.12
TagsNo tags attached.

Relationships

related to 0015612 resolvedmichiel Attributes' order of listing on subscribe page cannot be saved (not fixed in 2.10.13) 
related to 0017532 resolvedmichiel problems with default value: select not being default on subscribe page 
child of 0015369 resolvedmichiel 2.10.10 initial patches 

Activities

h2b2

12-05-09 02:39

manager   ~0050642

Correction: my test system is running 2.10.10, not 2.10.9

meeble

17-05-09 22:59

reporter   ~0050651

ALSO,

When editing a subscription page, neither "order of listing" nor "Is this attribute required?" settings are being saved when hitting "Save" or "Save and Activate".

ripls

19-05-09 02:05

reporter   ~0050656

Upgraded today to 2.10.10 and having the same problem with attributes. Can't delete them, change order (see below)or make required fields. Saving the settings does not take effect.

Can re-order attributes in attributes area, but not on subscribe page setup.

davman

20-05-09 13:06

reporter   ~0050660

Solved!!!
The problem is not only this.
The system doesn't recognise the required attributes and doesn't store in db the corrected values

To solve all this 2 bugs there's a little work to to waiting for the correct fixed version:


Create attributes with gui as usual
Edit with phpmyadmin or similar the table "phplist_user_attribute"
and put "1" in field "required" for fields you want ti be required
and setup the correct listorder values for all record in "listorder" field



open file subscribelib2.php and

replace this line
  foreach ($attributes as $attribute => $listorder) {
with this line
  foreach (array_reverse($attributes, true) as $attribute => $listorder) {


Comment these two lines:
  $attr["required"] = $attributedata[$attr["id"]]["required"];
  $attr["default_value"] = $attributedata[$attr["id"]]["default_value"];


Ciao!

tipichris

29-05-09 21:49

reporter   ~0050667

I think this is an import globals issue. This patch solves it:

--- lists/admin/spageedit.php.orig Fri May 29 21:42:49 2009
+++ lists/admin/spageedit.php Fri May 29 21:44:18 2009
@@ -54,9 +54,9 @@
   if (isset($_POST['attr_use']) && is_array($_POST['attr_use'])) {
     $cnt=0;
     while (list($att,$val) = each ($_POST['attr_use'])) {
- $default = $attr_default[$att];
- $order = $attr_listorder[$att];
- $required = $attr_required[$att];
+ $default = $_POST['attr_default'][$att];
+ $order = $_POST['attr_listorder'][$att];
+ $required = $_POST['attr_required'][$att];

       Sql_Query(sprintf('insert into %s (id,name,data) values(%d,"attribute%03d","%s")',
         $tables["subscribepage_data"],$id,$att,

davman

30-05-09 08:44

reporter   ~0050668

Excellent!

tipichris

08-06-09 07:51

reporter   ~0050677

There are issues with RSS preferences not saving too. A more complete patch:

--- lists/admin/spageedit.php.orig Fri May 29 21:42:49 2009
+++ lists/admin/spageedit.php Sun May 31 20:32:45 2009
@@ -54,9 +54,9 @@
   if (isset($_POST['attr_use']) && is_array($_POST['attr_use'])) {
     $cnt=0;
     while (list($att,$val) = each ($_POST['attr_use'])) {
- $default = $attr_default[$att];
- $order = $attr_listorder[$att];
- $required = $attr_required[$att];
+ $default = $_POST['attr_default'][$att];
+ $order = $_POST['attr_listorder'][$att];
+ $required = $_POST['attr_required'][$att];

       Sql_Query(sprintf('insert into %s (id,name,data) values(%d,"attribute%03d","%s")',
         $tables["subscribepage_data"],$id,$att,
@@ -73,11 +73,11 @@
   }
   if (ENABLE_RSS) {
     Sql_Query(sprintf('replace into %s (id,name,data) values(%d,"rssintro","%s")',
- $tables["subscribepage_data"],$id,$rssintro));
+ $tables["subscribepage_data"],$id,$_POST['rssintro']));
     Sql_Query(sprintf('replace into %s (id,name,data) values(%d,"rss","%s")',
- $tables["subscribepage_data"],$id,join(',',$rss)));
+ $tables["subscribepage_data"],$id,join(',',$_POST['rss'])));
     Sql_Query(sprintf('replace into %s (id,name,data) values(%d,"rssdefault","%s")',
- $tables["subscribepage_data"],$id,$rssdefault));
+ $tables["subscribepage_data"],$id,$_POST['rssdefault']));
   }
   if (!empty($_POST['activate'])) {
     Sql_Query(sprintf('update %s set active = 1 where id = %d',

mrmusicman86

10-06-09 22:06

reporter   ~0050682

tipichris,

Your last revision solved my problem with 2.10.10.

Thanks!

medianetwork

24-07-09 17:34

reporter   ~0050697

Could someone please tell me exactly where to put both of these patches? Is this on one of the php pages or do you have to add it to the sql tables and if so where?

Also, after doing this patch do you find any other problems with 2.10.10?

Thank you for your help.

medianetwork

24-07-09 18:48

reporter   ~0050698

I tried correcting the spageedit.php with the above and I lost the subscribe page from with in the admin and it did not change or correct anything.

kedmiston

27-08-09 17:55

reporter   ~0050715

Has this been resolved yet? I tried to apply the patch above for the lists/admin/spageedit.php script but it still does not sort in order nor does it identify required status correctly. It is saving to the database ok, just not displaying ok. As a side note; I found that the sort order was corrected if I commented out line 8785 ("asort($attributes);") from lists/admin/connect.php. The required issue was still a factor, however.

kedmiston

27-08-09 18:40

reporter   ~0050716

Typo on line number above...should be 875, not 8785

h2b2

28-08-09 05:44

manager   ~0050721

Patch suggested by tipichris works fine on my system, and also fixes the required attribute issue.

The patched spageedit.php file is available as an attachment in this forum post: http://forums.phplist.com/viewtopic.php?p=67474#p67474

michiel

27-11-09 18:04

manager   ~0050788

revision 1701