Affects Version/s: 7.3.X, Master
Component/s: Content Display Widgets > Web Content Search widget
When setting a web content article to non-searchable, it cannot be found even by the search in the web content selector of the WCD portlet. This is not the intended behavior; the web content selector is intended to be used to look up all web content articles, both searchable and non-searchable, since it is used by web content authors. This issue occurs due to commit 37884740685a7dc18148a132f606e8db58a940c5, which sorted some of the `setAttribute` calls before the `setAttributes` call, causing some attributes (including the "showNonindexable" attribute which is relevant to this bug) to be erased.
Steps to reproduce
1. Create a Web Content Structure named "Animal"
2. Add a "Web Content" field to the Structure
3. Change the Field Label to "Similar Animal"
4. Press Save
5. Create a Template for the Animal Structure.
6. Give the template a title.
7. Press Save
8. Create a non-searachable Animal named "Hippo" (leave the "Similar Animal" field empty).
9. Create a new Animal. This time, open up the "Select" menu for the "Similar Animal" field.
10. Notice that "Hippo" currently appears in the selector menu.
11. Type "Hippo" into the search bar and press the search icon
Expected Result: The "Hippo" Animal would appear in the search results.
Actual Result: The "Hippo" Animal does not appear in the search results. Instead, no search results are found.