Details
Description
A strange CiviGrant bug. On one of our sites, grants in any of these statuses do not display:
Ineligible to go to panel
Going to panel
Unsuccessful at panel
The common feature is the word "panel"! I've verified that renaming status to e.g. "Unsuccessful at test" makes the grants appear.
In search results, the results header shows the correct count but the grants do not appear. If you check the page source in Firebug, the grants are actually there but set to "display: none".
Similarly when viewing a contact's Grants tab: any grants in the above statuses do not appear.
Replicated on demo by creating grant status "Test panel" & creating some grants.
The problem seems to be the way classes are applied to table rows:
<tr id="crm-grant_77" class="odd-row crm-grant crm-grant_status-Going to panel">
- Because spaces in the status label are not escaped, the classes "to" and "panel" are added.
That means that this jQuery code...
cj('#crm-container')
.bind('click', function(event) {
if (cj(event.target).is('.btn-slide'))
else
{ cj('.btn-slide .panel').hide(); cj('.btn-slide-active').removeClass('btn-slide-active'); }
});
...applies display:none.
The class is applied in CRM/Grant/Form/Selector.tpl and AFAICS is not referenced elsewhere in the codebase, I guess it was just added to facilitate theming. I've verified that removing the grant_status class from the template fixes the problem.
I suspect the best fix is to transform spaces in the status label in the template. Is there a standard Civi way of doing this?