×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Filters and Search are not loaded
Tim Best
Fresh Boarder
Posts: 3
9 Jahre 20 Stunden her #1121
von Tim Best
Filters and Search are not loaded wurde erstellt von Tim Best
Hey everybody,
on my latest component the filters and search fields are not showing up. Only the buttons for search and clear are there.
In older components then filtering works like a charm on the same system.
I checked back on another system and there the new component works
I investigated this a little bit and found out that the code has changed there and the $filter settings are not loaded.
I guess there was something changed that my strict server is not accepting.
Does anybody has an idea where to check first or should I provide more info about the systems?
Thank you in advance
Tim
on my latest component the filters and search fields are not showing up. Only the buttons for search and clear are there.
In older components then filtering works like a charm on the same system.
I checked back on another system and there the new component works
I investigated this a little bit and found out that the code has changed there and the $filter settings are not loaded.
I guess there was something changed that my strict server is not accepting.
PHP Notice: Undefined variable: filtered in /var/www/html/services/intranet/cms/components/com_erp_extension/views/stammdatens/tmpl/default_filter.php on line 55,
PHP Notice: Trying to get property of non-object in /var/www/html/services/intranet/cms/components/com_erp_extension/views/stammdatens/tmpl/default_filter.php on line 76,
Does anybody has an idea where to check first or should I provide more info about the systems?
Thank you in advance
Tim
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Randy Carey
Junior Boarder
Posts: 23
8 Jahre 11 Monate her - 8 Jahre 11 Monate her #1125
von Randy Carey
Randy Carey antwortete auf Filters and Search are not loaded
I ran into this, as well, a couple of days ago. Using a debugger, I found the line to change...
First, my apologies... The first solution I posted here was incomplete. I returned to the original template file to recall the exact problem. Here is it is...
In the template file default_filter (site, for the view that lists the items), there is a block of code for all the dropdown filters. In my file, this code is found on lines 37-38: <?The problem is that $filters is false, so the loop of displaying each filter is never run. But this variable should be a collection of the available filters so that when the loop is run, each filter within that collection is displayed.
Now the fitler objects do exist - but the variable $filters never gets set to them. Backtracking up the file, I see that filter is set with this conditional statement:but the variable $data is null, so the condition is always false and the variable $filters is never set to the list of fitlers. To correct that, I just added this line (before the condition):
So adding that one line should be all you need.
Returning to my earlier response, it is probably best to disregard.... My debugger was showing that $field->input
was null so I added the traditional line of code that creates the HTML for a field : <?php echo $this->filterForm->getInput($fieldName); ?> Since posting, I'm finding that echo $field->input; is indeed inserting the needed HTML - but for some reason my debugger still shows its value as being null until after this variable is echoed. In short, the extra line to ->getInput($fieldName) seems not to be needed. Sorry for any confusion.
For what it's worth, the component where I stumbled upon this was for a 2.5 site.
First, my apologies... The first solution I posted here was incomplete. I returned to the original template file to recall the exact problem. Here is it is...
In the template file default_filter (site, for the view that lists the items), there is a block of code for all the dropdown filters. In my file, this code is found on lines 37-38: <?
php if ($filters) : ?>
<?php foreach ($filters as $fieldName => $field) : ?>
Now the fitler objects do exist - but the variable $filters never gets set to them. Backtracking up the file, I see that filter is set with this conditional statement:
if (isset($data['view']->filterForm))
{
$filters = $this->filterForm->getGroup('filter');
}
$filters = $this->filterForm->getGroup('filter');
So adding that one line should be all you need.
Returning to my earlier response, it is probably best to disregard.... My debugger was showing that $field->input
was null so I added the traditional line of code that creates the HTML for a field : <?php echo $this->filterForm->getInput($fieldName); ?> Since posting, I'm finding that echo $field->input; is indeed inserting the needed HTML - but for some reason my debugger still shows its value as being null until after this variable is echoed. In short, the extra line to ->getInput($fieldName) seems not to be needed. Sorry for any confusion.
For what it's worth, the component where I stumbled upon this was for a 2.5 site.
Letzte Änderung: 8 Jahre 11 Monate her von Randy Carey.
Folgende Benutzer bedankten sich: Tim Best
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Tim Best
Fresh Boarder
Posts: 3
8 Jahre 11 Monate her #1131
von Tim Best
Tim Best antwortete auf Filters and Search are not loaded
Thank you. I will try this asap and provide some feedback here.
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Ladezeit der Seite: 0.052 Sekunden