• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

error "group by" when updating

JBosir

Member
Hello.
I updated all and I get a problem with "group by".

The groups makes them perfectly, but the header, comes the element of the first record.

Another issue, you can remove the result of grouping elements coming out in parentheses, for example element (10)?

I put an example image
 

Attachments

  • imagen.png
    imagen.png
    266.3 KB · Views: 135
I've fixed that issue with the group by heading.
I've also added a new layout file, 'components/com_fabrik/layouts/list/fabrik-group-by-heading.php
You can copy that into a folder html/layouts in your current template directory and then override the layout there.
 
I saw another problem.
The data "group by" I order by date.
And I need to put the current first.
The problem is that does not work the order direction.
The order by Ascending or Descending is not working.
Thank you.
 
the ordering should take place but the group by takes precedence - so if you group by 'male/female' and then order by age, you should see all males together ordered by age, then all females together ordered by age,.

Is this not the case for you?
 
I have the ordering and group by date. But
Sure I do something wrong. :(
View image.
 

Attachments

  • imagen.png
    imagen.png
    33 KB · Views: 115
  • imagen.png
    imagen.png
    341 KB · Views: 108
If you enable Fabrik debug, and append &fabrikdebug=1 to the list URL, what does the GetData query look like?

I would take a look, but your My Sites doesn't seem to be up to date.

-- hugh
 
Hi, I tested with ?Fabrikdebug=1.
The problem is that when I do "Group by: Date" in the SQL statement always gives priority ascending order ORDER BY `mv_winners`.`date_time` ASC independent of other parameters.

Test (in list):
1.-Data -> Data:
Order by: Date - Descending
Data -> Group by:
Group by: -
Order by: -
Result: ORDER BY `mv_winners`.`date_time` DESC

2.-Data -> Data:
Order by: Date - Descending
Data -> Group by
Group by: -
Order by: Date - Descending
Result: ORDER BY `mv_winners`.`date_time` DESC,`mv_winners`.`date_time` DESC

3.-Data -> Data:
Order by: Date - Descending
Data -> Group by
Group by: Date
Order by: Date - Descending

Result: ORDER BY `mv_winners`.`date_time` ASC, `mv_winners`.`date_time` DESC,`mv_winners`.`date_time` DESC
 
4.-Data -> Data:
Order by: -
Data -> Group by
Group by: Date
Order by: -

Result: ORDER BY `mv_winners`.`date_time` ASC
 
you won't be able to order on the same column twice in two different directions. Remove the main order by, or replace it's selection with another element.
 
I think the problem (see section 4) is that when I group by data, by default puts in ascending order. There is then no way to put the same field in descending order.
 
I don't think it does it by default, your main list "order by" has it ordering by date ascending. As we do both the main order by and the group by order by in the one query its impossible to achieve ordering on both.
Did you try my suggestion of removing/changing the main order by?
 
5.-Data -> Data:
Order by: winnerId -Descending
Data -> Group by
Group by: Date
Order by: winnerId - Descending

Result: ORDER BY `mv_winners`.`date_time` ASC, `mv_winners`.`winnerId` DESC,`mv_winners`.`winnerId` DESC

always orders in the first date ASC

If it's any help:
In:
6.-Data -> Data:
Order by: Date - Descending
Data -> Group by
Group by: Date
Order by: -

Result: ORDER BY `mv_winners`.`date_time` ASC, `mv_winners`.`date_time` DESC


I remove the following line components / com_fabrik / models / list.php and works. not the first condition appears. (line 2795)
PHP:
if ($query !== false && is_object($query))
       {
         //$query->order(FabrikString::safeColName($groupBy, false) . ' ASC');
       }

and it works for me
Result: ORDER BY `mv_winners`.`date_time` DESC

Thanks.
 
Hmmm, that is the code which handles ordering by column via the list display itself, i.e. if you click on a column heading for an element with ordering enabled.

Do you have "Allow ordering" set for your date_time element?

I'm not sure if it makes sense to allow that, if the list itself is ordered by that element. I'm fairly sure the clickable element ordering will be appended to the list / group ordering, so I don't think will have any effect if for elements used in the main list ordering.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top