Only 1 error message shown even though there are 2 on "Site options"

Bug #1844076 reported by Kristina Hoeppner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Lisa Seeto

Bug Description

Seen on MyPortfolio.school.nz: We moved the site and hadn't yet set up Elasticsearch and ClamAV. When I went to Admin menu -> Configure site -> Site options, I only saw the Elasticsearch error message that it was misconfigured. Only once that error was resolved did I see the ClamAV error message:

You have activated virus checking, but have not set a "Path to ClamAV" value. Virus checking will not take effect until you configure the path to ClamAV by adding a $cfg->pathtoclam value to your config.php file.

Precondition:
- turn on ClamAV but misconfigure it in the config.php
- turn on Elasticsearch and configure it. Then turn the Elasticsearch server off so it's not reachable.

Test steps:
1. Go to Admin menu -> Configure site -> Site options.
2. Click the "Update site options" button as you may not see the error message directly.
3. You see an error message that Elasticsearch is not turned on.
Expected result: You also see the ClamAV message

Actual result: Only the Elasticsearch message is shown until it is resolved and then the ClamAV error message is displayed.

Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi Lisa

Can you look in the code in master to see why this may be the case

Changed in mahara:
assignee: nobody → Lisa Seeto (lisaseeto)
Lisa Seeto (lisaseeto)
Changed in mahara:
status: Confirmed → In Progress
Revision history for this message
Lisa Seeto (lisaseeto) wrote :

Hi Robert,

In options.php where the "siteoptions" form is processed, the search plugin option is processed before the virus checking option. This means if there is an error with the search plugin (like in this case) the form replies with PIEFORM_ERR in order of elastic search first, then clamav later which is why only the elastic search message is returned (it stops processing on a form reply and redirect so didn't get any further in the file than that).

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/10616

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10616
Committed: https://git.mahara.org/mahara/mahara/commit/fd657370f5137cac256f1c357d3210752587d6d6
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit fd657370f5137cac256f1c357d3210752587d6d6
Author: Lisa Seeto <email address hidden>
Date: Wed Nov 20 10:21:06 2019 +1300

Bug 1844076: Only 1 error message shown even though there are 2 on "Site options"

- refactor networkingform & siteoptionform to not use _fail funcs
- siteoptionform now has its own validation func

behatnotneeded

Change-Id: I219ec6cbb56aa559b60a9cd97226601e2008305d
Signed-off-by: Lisa Seeto <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.