Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

fix(api): Removing host type AND having the cursor in the search bar sends an error 500 #8432

Closed
wants to merge 2 commits into from

Conversation

vhr
Copy link
Contributor

@vhr vhr commented Mar 19, 2020

Description

when the user sends invalid regexp to with operator $rg server will throw an exception from the DB,
the idea is to change the REGEXP with LIKE when the syntax is not valid

Fixes MON-5034

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software
  • Updating documentation (missing information, typo...)

Target serie

  • 2.8.x
  • 18.10.x
  • 19.04.x
  • 19.10.x
  • 20.04.x (master)

How this pull request can be tested ?

send GET request to http://localhost/centreon/api/beta/monitoring/resources?page=1&limit=100&search={%22$or%22:[{%22name%22:{%22$rg%22:%22a%22}}]}

Checklist

Community contributors & Centreon team

  • I followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have made corresponding changes to the documentation.
  • I have rebased my development branch on the base branch (master, maintenance).

Centreon team only

  • I have made sure that the unit tests related to the story are successful.
  • I have made sure that unit tests cover 80% of the code written for the story.
  • I have made sure that acceptance tests related to the story are successful (local and CI)

victorvassilev
victorvassilev previously approved these changes Mar 19, 2020
kduret
kduret previously approved these changes Mar 20, 2020
Copy link
Contributor

@kduret kduret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@callapa could you take a look to please :)

…tersTranslator.php

Co-Authored-By: Kevin Duret <kduret@centreon.com>
@vhr vhr dismissed stale reviews from kduret and victorvassilev via 4fe3baa March 20, 2020 08:44
Copy link
Contributor

@callapa callapa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't accept this modification.
The system does not have to correct this kind of error.
If the user is using regex he must have written them.

@vhr
Copy link
Contributor Author

vhr commented Mar 26, 2020

the fix was implemented in https://github.com/centreon/centreon/pull/8437

@vhr vhr closed this Mar 26, 2020
@adr-mo adr-mo deleted the MON-5034-err-500 branch March 19, 2021 14:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants