Relationship Graph View Issue Dependency Graph
related to child of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0019994phpList 3 applicationCampaign Send Processpublic19-07-19 13:46
Reporterpetersphilo 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version3.4.2 
Target Version3.4.4Fixed in Version3.4.4 
Summary0019994: 'Select All' checkmark not working when selecting lists for send
DescriptionThe problem is in the file:
/admin/js/phplistapp.js

At line 60, it should be:
// Function to check/ uncheck all the boxes in a category.
function checkAllBoxes(checked, checkboxes) {
    checkboxes.each(function () {
        if (checked) {
            $(this).find('input[name^=targetlist]').prop('checked', true);
        }
        else {
            $(this).find('input[name^=targetlist]').prop('checked', false);
        }
    });
}


The attribute was 'id' but should be name



And at line 444, here's what i did:

    // tick all the boxes in a category.
    $('li.selectallcategory').on('click', function () {
        if ($(this).find('input[type=checkbox]').attr('name').match('all-lists')) {
            var ul = $(this).parent();

            checkAllBoxes(ul.find('input[name^=all-lists]').prop('checked'), ul);
        }
    });



again, attribute was 'id' but should be 'name'

also, the call to checkAllBoxes calls the parent of the parent.. that didn't work, at least in Safari, Chrome, and Opera on Mac
TagsNo tags attached.

Activities

petersphilo

20-06-19 08:16

reporter  

phplistapp.js (18,967 bytes)

petersphilo

20-06-19 08:50

reporter   ~0062432

Fix included above

samtuke

20-06-19 10:17

administrator   ~0062433

@petersphilo Thanks for contributing!

petersphilo

20-06-19 12:28

reporter   ~0062434

@samtuke my pleasure!
Sorry it took me so long to get around to it...

Quick note: on the 3 PHPList installations i manage, lists are organized in categories, so i can't say whether this issue exists if you have no categories...

Also, this issue has been around for a very, very long time (at least since 3.1.x)..
i'm surprised that i've not found mention of it in Mantis..

Thank you all for PHPList!!
it really rocks!

brunilda

26-06-19 08:17

manager   ~0062498

Last edited: 26-06-19 13:02

View 7 revisions

@petersphilo

Checking all boxes using id attribute affects 'match('all-lists') ' property as undefined.
It works well with name attribute as it is declared in \admin\connect.php file:

// Add select all checkbox in every category to select all lists in that category.
                if ($category == 'selected') {
                    $content = sprintf('<li class="selectallcategory"><input type="checkbox" name="all-lists-'.$fieldname.'-cat-'.str_replace(' ',
                                '-',
                                strtolower($category)).'" checked="checked">'.s('Select all').'').$content;
                 }

Thanks for contributing!

You wrote:
also, the call to checkAllBoxes calls the parent of the parent.. that didn't work, at least in Safari, Chrome, and Opera on Mac.

checkAllBoxes function works ok calling lists by name and not id.

Let us know if you have any other questions.

PR on GitHub:
https://github.com/phpList/phplist3/pull/560