ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-4983

Cannot import 1.8 host/template with macro if it already exists

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0.0rc1
    • Fix Version/s: 2.0.4rc1, 2.1.0
    • Component/s: Frontend (F)
    • Labels:
      None

      Description

      Try to import given file twice.

        Activity

        Hide
        Alexander Vladishev added a comment -

        Please, specify "Affects Version/s"

        Show
        Alexander Vladishev added a comment - Please, specify "Affects Version/s"
        Hide
        Alexei Vladishev added a comment -

        I am getting 'Macro "{$ASD}" already exists on "Exp Temp 001".' when trying to import this template twice in the latest trunk.

        Show
        Alexei Vladishev added a comment - I am getting 'Macro "{$ASD}" already exists on "Exp Temp 001".' when trying to import this template twice in the latest trunk.
        Hide
        Alexey Fukalov added a comment -

        dev branch: svn://svn.zabbix.com/branches/dev/ZBX-4983

        Show
        Alexey Fukalov added a comment - dev branch: svn://svn.zabbix.com/branches/dev/ZBX-4983
        Hide
        Toms added a comment - - edited

        (1) Consider easy fix replacing order of

        if ($macroIdsToDelete)

        { $this->delete($macroIdsToDelete); }

        if ($macrosToAdd)

        { $this->create($macrosToAdd); }

        in CUserMacro.php replaceMacros() function

        but regarding solution with extra SELECT statement, I think It would be better to make that check inside replaceMacros() function

        Error still persist in template edit form, if you remove macro and add macro with same name and then try to save changes.

        Alexey Fukalov RESOLVED

        <Toms> CLOSED

        Show
        Toms added a comment - - edited (1) Consider easy fix replacing order of if ($macroIdsToDelete) { $this->delete($macroIdsToDelete); } if ($macrosToAdd) { $this->create($macrosToAdd); } in CUserMacro.php replaceMacros() function but regarding solution with extra SELECT statement, I think It would be better to make that check inside replaceMacros() function Error still persist in template edit form, if you remove macro and add macro with same name and then try to save changes. Alexey Fukalov RESOLVED <Toms> CLOSED
        Hide
        Toms added a comment -

        TESTED

        Show
        Toms added a comment - TESTED
        Hide
        Alexey Fukalov added a comment -

        Fixed in 2.0.4rc1 r30539, pre-2.1.0 r30540.

        Show
        Alexey Fukalov added a comment - Fixed in 2.0.4rc1 r30539, pre-2.1.0 r30540.
        Hide
        Pavels Jelisejevs added a comment - - edited

        (2) Please document the API fix in the 2.0 changelog.

        Alexey Fukalov CLOSED

        Show
        Pavels Jelisejevs added a comment - - edited (2) Please document the API fix in the 2.0 changelog. Alexey Fukalov CLOSED

          People

          • Assignee:
            Alexey Fukalov
            Reporter:
            Toms
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: