Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19495

Inconsistend sorting of export with MySQL and Postgres

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 5.4.0
    • Frontend (F)
    • None

      Steps to reproduce:

      1. Setup Zabbix Froentend with Postgres database.
      2. Export templates to file template_os_linux.yaml and compare with Zabbix git repository.

      Result:
      **

      Expected:
      The same order of fields as in repository and in other exports using MySQL database.

      Possible fix:

      Something like this seems improve the behavior:

      --- /usr/share/zabbix/include/classes/export/CConfigurationExportBuilder.php_orig       2021-05-11 17:39:54.000000000 +0300
      +++ /usr/share/zabbix/include/classes/export/CConfigurationExportBuilder.php    2021-06-01 01:33:46.837862216 +0300
      @@ -1257,7 +1257,7 @@
              protected function formatWidgetFields(array $fields) {
                      $result = [];
       
      -               CArrayHelper::sort($fields, ['type']);
      +               CArrayHelper::sort($fields, ['type', 'name', 'value']);
       
                      foreach ($fields as $field) {
                              $result[] = [
      

            rvaliahmetovs Renats Valiahmetovs (Inactive)
            vanav Ivan Vanyushkin
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: