Bug #2082

Group (User) UI module: opening a group for update fails

Added by Davide Principi about 8 years ago. Updated almost 8 years ago.

Status:CLOSEDStart date:08/22/2013
Priority:NormalDue date:08/22/2013
Assignee:-% Done:

100%

Category:nethserver-mail-server
Target version:v6.4-beta2
Security class: Resolution:
Affected version:v6.4-beta1 NEEDINFO:No

Description

Opening a group with some email addresses fails. The browser console reports:

Uncaught TypeError: Object  has no method 'appendTo' 7f08881b.js:1610

This corresponds to TextList widget source:nethserver-nethgui|Nethgui/Js/jquery.nethgui.textlist.js#L51

Actually the server returns an object instead of an array:

{"0":"redmine@nethesis.it","2":"redmine@nethesis.it","1":"redmine@progettofreedom.it"}

Indexes are 0, 2, 1: json_encode converts the PHP array into a JSON object, where an array was expected.

NOTE:
This bug affects also the User UI module, but originally it was not reported.

packages-list-20130724.txt Magnifier - List of installed RPMs (1.42 KB) Davide Principi, 07/24/2013 10:48 AM


Related issues

Related to NethServer 6 - Bug #2151: group-create event fails on nethserver-mail-group-acl-adj... CLOSED 11/14/2013 11/14/2013

Associated revisions

Revision a78d2c2b
Added by Davide Principi almost 8 years ago

jquery.nethgui.textlist.js (_updateView): cast text() argument to native JS string, to avoid method-chaining breaks. Refs #2082

Revision 2461f47b
Added by Davide Principi almost 8 years ago

AccountPseudonymIterator (getPseudonymList): return a numerically indexed array with unique elements. Refs #2082

History

#1 Updated by Davide Principi almost 8 years ago

  • Due date set to 08/22/2013
  • Status changed from TRIAGED to ON_DEV
  • Start date set to 08/22/2013
  • % Done changed from 20 to 30

#2 Updated by Davide Principi almost 8 years ago

I can reproduce the problem with the following procedure:
  • Create a group "g1", enabling Email. This creates a default pseudonym "g1@"
  • Add a pseudonym g1@primarydomain.tld

The response to https://host.primarydomin.tld:980/Group/update/g1.json contains

{"1":"g1@vboxnet0.tld","0":"g1@vboxnet0.tld"}

Where the following JSON array was expected by TextList widget:

["g1@vboxnet0.tld","g1@vboxnet0.tld"]

As an improvement, we can remove the duplicate result.

#3 Updated by Davide Principi almost 8 years ago

  • Subject changed from Group UI module: opening a group for update fails to Group (User) UI module: opening a group for update fails
  • Description updated (diff)

Bug affects also User UI module.

#4 Updated by Davide Principi almost 8 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

Test case

Reproduce the problem before and after applying the modified version (see #2082#note-2)

#5 Updated by Davide Principi almost 8 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-mail-server-1.4.5-2.0git2461f47b.ns6.noarch.rpm
nethserver-nethgui-1.2.2-1.0gita78d2c2b.ns6.noarch.rpm

#6 Updated by Giacomo Sanchietti almost 8 years ago

  • Assignee set to Giacomo Sanchietti

#7 Updated by Giacomo Sanchietti almost 8 years ago

Created group named "group2" with email activated.

Web UI works correctly. Extract from json:

["Tf4e7c87a",["group2@test.loc"]

By the way, creation of group fails on nethserver-mail-group-acl-adjust:

Aug 29 13:42:50 localhost esmith::event[18077]: Running event handler: /etc/e-smith/events/group-create/S95nethserver-mail-group-acl-adjust
Aug 29 13:42:53 localhost esmith::event[18077]: [ERROR] IMAP error for account group1: 0001 NO [NONEXISTENT] Mailbox doesn't exist: INBOX#015
Aug 29 13:42:53 localhost esmith::event[18077]: S95nethserver-mail-group-acl-adjust=action|Event|group-create|Action|S95nethserver-mail-group-acl-adjust|Start|1377783770 841050|End|1377783773 425205|Elapsed|2.584155|Status|256
[ ... ]
Aug 29 13:42:53 localhost httpd-admin: [ERROR] Nethgui\System\NethPlatform: process `group-create-521f4fca832eb` on queue `post-process` exited with code 1. Output: ``

Extract from accounts db:

group1=group
    Description=group1
    Gid=5000
    MailDeliveryType=copy
    MailStatus=enabled
    Members=

Same error when updating an existing group.

#8 Updated by Davide Principi almost 8 years ago

Giacomo Sanchietti wrote:

By the way, creation of group fails on nethserver-mail-group-acl-adjust:

Filed bug #2151, related to this issue and #1879.

See nethserver-mail-server|20b09a3

#9 Updated by Davide Principi almost 8 years ago

Packager note
Release this bugfix when #2151 has been verified too

#10 Updated by Giacomo Sanchietti almost 8 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 90
Tested with:
  • nethserver-mail-server-1.4.5-2.0git2461f47b.ns6.noarch
  • nethserver-nethgui-1.2.3-1.ns6.noarc

Marking as VERIFIED.

#11 Updated by Davide Principi almost 8 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100

In nethserver-updates:
nethserver-mail-common-1.3.1-1.ns6.noarch.rpm
nethserver-mail-filter-1.1.2-1.ns6.src.rpm
nethserver-mail-server-1.4.6-1.ns6.noarch.rpm
nethserver-antivirus-1.0.5-1.ns6.noarch.rpm

Dependencies:
unzoo-4.4-7.el6.x86_64.rpm
altermime-0.3.10-3.el6.x86_64.rpm
amavisd-new-2.8.0-4.el6.noarch.rpm
clamav-db-0.97.8-1.el6.x86_64.rpm
clamav-0.97.8-1.el6.x86_64.rpm
clamd-0.97.8-1.el6.x86_64.rpm
lrzip-0.614-1.el6.x86_64.rpm
p7zip-plugins-9.20.1-2.el6.x86_64.rpm
perl-DBD-SQLite-1.27-3.el6.x86_64.rpm
perl-Razor-Agent-2.85-6.el6.x86_64.rpm

Also available in: Atom PDF