Bug noted on master @ 75bad1b64bd485a50af69ed1f8663a0dadbb5f9e Selecting one of the layer state filter options, i.e. - "All" - "Layers added to this project" - "Layers not added to this project" from the filter button on the "Add | Delete" column does not update the add/remove buttons for the displayed layers correctly. For example: (1) After the "Layers added to this project" filter is applied, layers in the project still display the "Add layer" button, rather than the "Remove layer" one. (2) After the "Layers not added to this project" filter is applied, layers not in the project still display the "Remove layer" button rather than the "Add layer" one. To replicate (1): * Start Toaster in managed mode. * Add a new project. * Click the "Layers" link in the "Compatible metadata" menu (left-hand side). * Add a layer via its "Add layer" button. NB the layer is added correctly. * Change the filter (funnel icon in right-most column) to "Layers added to this project". The layers display correctly in the filtered list, but they have the wrong buttons ("Add layer" rather than "Remove layer"). Refreshing the page shows the correct buttons. The source of the issue seems to be that the ctx for the page is set when the page is first loaded, including which layers are in the project; however, when you apply the filter, the ctx is not changed, so it contains old information about the project's layers. Because tableInit() resets the show/hide state of the add/remove layer buttons every time it's called, the information about the current state of the layer is then being overwritten when the filter is applied to the table.
Note that this superficially appears to be similar to https://bugzilla.yoctoproject.org/show_bug.cgi?id=7660, the source of the error is different: it's not because of history manipulation and/or HTTP caching, as in 7660; but rather because the data used to redraw the table is incorrect, as it is not refreshed when the filter is applied.
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=ab896df63ba058f535cb303611574f293c7c680b
Verified on master: fc45deac89ef63ca1c44e763c38ced7dfd72cbe1