Removing selection from sendout subscriptions/mailing lists dropdown
Hi all,
I'm using NewsletterStudio v1.3.3 and i noticed that when I select multiple subscriptions/mailing lists in the sendout page I can't de-select any of the selected items, the dropdown checklist keeps the selected items and doesn't remove them if I remove selection. The only way to remove items is to reload the sendout page.
I tried with Chrome (26), Firefox (20.0) and IE (9). I see the problem both for new letters and scheduled ones.
I see no javascript errors on the page.
This is an example of what it happens: I select both "Default" and "MailingList 1" items, then I de-select "MailingList 1" item but it remains into the selection list.
Same behaviour with Umbraco 6.0.3 too. Maybe it's a problem with dropdown checklist client control that keeps the selection of items that were selected and then de-selected.
I see, yes I don't know is strange becuse i can't reproduce the problem. What plattform are you running? Mac? Windows8?
Did you try (not that i think it should matter) to remove the "UmbracoSubscriptionProvider" from the config? Since it empty? I don't it matters but you can never know.
I'm running on Windows 7. I tried to remove all subscription providers and keep only NewsletterStudio one but the issue is still there, even if the list has only one item.
I tried to inspect the multiselect widget and I saw that after I de-select an option the related hidden select option maintains the "selected" attribute set to "selected".
So, I debugged the umbraco/newsletterstudio/js/ui.dropdownchecklist-1.3-min.js script file and I saw that the _syncSelected function inside it performs the sync between the widget ui and the hidden select input. Inside that function there is a for each loop that sets the "selected" attribute of the hidden select input options starting from the widget "checked" items. I changed that code in order to set the "selected" attribute when the widget item is checked and to remove the "selected" attribute when the widget item is un-checked. Now it works (I tested this solution with Chrome, Firefox and IE).
I don't know if I'm the only one having this issue, however I hope that my explanation is clear enough and this code can be helpful for anyone facing with the same issue ;)
Here is the code.
_syncSelected: function (g) {
var h = this,
j = this.options,
b = this.sourceSelect,
d = this.dropWrapper;
var c = b.get(0).options;
var f = d.find("input.active");
if (j.firstItemChecksAll) {
if ((g == null) && a(c[0]).attr("selected")) {
f.attr("checked", true)
} else {
if ((g != null) && (g.attr("index") == 0)) {
f.attr("checked", g.attr("checked"))
} else {
var e = true;
var i = null;
f.each(function (k) {
if (k > 0) {
var l = a(this).attr("checked");
if (!l) {
e = false
}
} else {
i = a(this)
}
});
if (i != null) {
i.attr("checked", e)
}
}
}
}
f = d.find("input");
f.each(function (k) {
/* original code *****************///a(c[k]).attr("selected", a(this).attr("checked"))/*********************************//* new code *********************/var x = a(this);
if (a(this).attr("checked")) {
a(c[k]).attr("selected", a(this).attr("checked"));
} else {
a(c[k]).removeAttr("selected");
}
/**********************************/
});
h._updateControlText();
if (g != null) {
g.focus()
}
}
I'm impressed with your work on this one and very greatful that you shared your solution! I'll have a closer look at this and see if i should include this code in the shipped version of Newsletter Studio, hope you are fine with that?
Once again, thank you very much! Have a great weekend!
Removing selection from sendout subscriptions/mailing lists dropdown
Hi all,
I'm using NewsletterStudio v1.3.3 and i noticed that when I select multiple subscriptions/mailing lists in the sendout page I can't de-select any of the selected items, the dropdown checklist keeps the selected items and doesn't remove them if I remove selection. The only way to remove items is to reload the sendout page.
Any help will be appreciated.
Regards
Matteo
Hi!
This is not a known bug. What browser are you using? Is it a new letter or a letter that has been scheduled for send out?
If this is not a local problem with your installation it feels like a browser issue....? Can you try in another browser?
EDIT I tried in IE, FF and Chrome and it works in all three. Even IE7 ;)
/ m
Hi Markus,
I tried with Chrome (26), Firefox (20.0) and IE (9). I see the problem both for new letters and scheduled ones.
I see no javascript errors on the page.
This is an example of what it happens: I select both "Default" and "MailingList 1" items, then I de-select "MailingList 1" item but it remains into the selection list.
No javascript errors? Have you looked at the console in ie. Chrome?
It "works on my machine" =D
What if you add a member group to the members section? Or if you comment this provider out from the /config/newsletterstudio.config?
/ m
Yes, no javascript error on the Console.
I tried with the latest Umbraco 4 version (4.11.6) and I've the same behaviour.
Same behaviour with Umbraco 6.0.3 too. Maybe it's a problem with dropdown checklist client control that keeps the selection of items that were selected and then de-selected.
Hi!
I see, yes I don't know is strange becuse i can't reproduce the problem. What plattform are you running? Mac? Windows8?
Did you try (not that i think it should matter) to remove the "UmbracoSubscriptionProvider" from the config? Since it empty? I don't it matters but you can never know.
// m
Hi Markus,
I'm running on Windows 7. I tried to remove all subscription providers and keep only NewsletterStudio one but the issue is still there, even if the list has only one item.
I tried to inspect the multiselect widget and I saw that after I de-select an option the related hidden select option maintains the "selected" attribute set to "selected".
So, I debugged the umbraco/newsletterstudio/js/ui.dropdownchecklist-1.3-min.js script file and I saw that the _syncSelected function inside it performs the sync between the widget ui and the hidden select input. Inside that function there is a for each loop that sets the "selected" attribute of the hidden select input options starting from the widget "checked" items. I changed that code in order to set the "selected" attribute when the widget item is checked and to remove the "selected" attribute when the widget item is un-checked. Now it works (I tested this solution with Chrome, Firefox and IE).
I don't know if I'm the only one having this issue, however I hope that my explanation is clear enough and this code can be helpful for anyone facing with the same issue ;)
Here is the code.
Regards
Matteo
Hi Matteo!
I'm impressed with your work on this one and very greatful that you shared your solution! I'll have a closer look at this and see if i should include this code in the shipped version of Newsletter Studio, hope you are fine with that?
Once again, thank you very much! Have a great weekend!
// Markus
Ok great, I'm glad if my solution can be helpful.
Hi!
Matteo
Matteo! =D
I just tested with the latest version of Umbraco 6.1 Beta... and had the same problem. I guess it's due to a jquery update or something.
I will make sure to include your fix in the next package release.
Big thank you!
Btw. Are you comming to codegarden? Say Hallo and I'll buy you a beer! =D
// m
Great Markus! Ok, if I come to Codegarden 13 I'll say you hello! ;)
is working on a reply...