[ZBX-5617] Class bug in select field Created: 2012 Sep 25  Updated: 2017 May 30  Resolved: 2012 Oct 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.0.2
Fix Version/s: 2.0.4rc1, 2.1.0

Type: Incident report Priority: Trivial
Reporter: Oleg Egorov (Inactive) Assignee: Oleg Egorov (Inactive)
Resolution: Fixed Votes: 0
Labels: class, frontend, input
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

/popup_trexpr.php - Trigger expression condition
"selectShorten" - duplicates in function select field

<select id="expr_type" class="input select selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten selectShorten" style="width: 373px;" onchange="submit()" size="1" name="expr_type">



 Comments   
Comment by Oleg Egorov (Inactive) [ 2012 Sep 28 ]

RESOLVED IN svn://svn.zabbix.com/branches/dev/ZBX-5617

Comment by Pavels Jelisejevs (Inactive) [ 2012 Sep 28 ]

(1) Your fix will not add the class if the element already has a class named selectShortenWhatever. It would be better to use the CTag::addClass() method and change it in a way, that would prevent it from adding duplicate class names.

oleg.egorov Resolved in revision 30411

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2012 Oct 02 ]

(2) Some coding style issues:
1. $ChkClass should start with a lower case letter;
2. $ChkClass=explode(' ', $this->getAttribute('class')); spaces are required around the equality sign;
3. the if clause can be replaced with just in_array($cssClass, $ChkClass);
4. a phpdoc comment is required for the CTag::hasClass() method.

oleg.egorov RESOLVED

jelisejev I've made a couple of corrections in r30472. Please review.

oleg.egorov CLOSED

Comment by Pavels Jelisejevs (Inactive) [ 2012 Oct 02 ]

TESTED.

But please close (2) before merging.

Comment by richlv [ 2012 Oct 04 ]

(3) there's a typo :
"Returns true if HTML class exist"

also, let's have a bit more descriptive changelog entry

oleg.egorov RESOLVED

Comment by Oleg Egorov (Inactive) [ 2012 Oct 09 ]

Fixed in pre-2.0.4 r30722 and pre-2.1.0 (trunk) r30723.

Generated at Thu Apr 25 06:42:07 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.