Bug 159985 - Changing Macro Security level should warn about the need to reload the file to apply the settings
Summary: Changing Macro Security level should warn about the need to reload the file t...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:24.8.0 inReleaseNotes:24.8
Keywords:
Depends on:
Blocks: Macro Privacy
  Show dependency treegraph
 
Reported: 2024-03-01 14:02 UTC by Rafael Lima
Modified: 2024-03-23 11:40 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Lima 2024-03-01 14:02:17 UTC
In Tools - Options - Security - Macro Security, if the user change the security level, the new level will only take effect after restarting LibreOffice.

However, LO does not warn about that after clicking OK or Apply. There should be a message telling the user that a restart is required.

This is important when the user changes the security level from High to Low (in order to be able to execute a macro from a file). Just changing the level and after that trying to use the macro won't work.
Comment 1 Mike Kaganski 2024-03-01 14:38:53 UTC
Changing security level doesn't need a restart. It applies to all documents opened after the change, in the same session. Even simple File->Reload already uses new level - I use that all the time.
Comment 2 Rafael Lima 2024-03-01 14:52:41 UTC
(In reply to Mike Kaganski from comment #1)
> Changing security level doesn't need a restart. It applies to all documents
> opened after the change, in the same session. Even simple File->Reload
> already uses new level - I use that all the time.

Indeed, I confirm that reloading the file will apply the new macro security settings.

However, don't you think this should be told to the user somehow?

So here is why I opened this ticket... In my classes, I create an ODS example file with many macros to help students understand the lecture. So when they open the file on the lab computers, their security level is always set to High. Then I tell the students to change the security level to Low, and all of them complain that it does not work (which makes sense, since they changed it to Low, pressed OK and nothing was said about needing to reload the file).

To overcome this issue, I always told students to restart LO... now from Mike's message, I'll tell students to reload the file instead. However, either way, there's no way the user can know that (I myself did not know that). If OK is pressed and no warning is presented, the user will expect it to work right away.
Comment 3 Rafael Lima 2024-03-01 14:54:05 UTC
I renamed the title based on Comment #1
Comment 4 Stéphane Guillou (stragu) 2024-03-04 06:26:51 UTC
I agree with Rafael something should change, because it always felt to me like something was missing or inconsistent with other requests to restart.
I can see how users would expect to be able to press a button that triggers a macro right after changing the security settings.
I always used to restart LO, not knowing a reload was enough.

The need for a reload is not mentioned in the corresponding help page: https://help.libreoffice.org/24.8/en-US/text/shared/optionen/macrosecurity_sl.html

UX/Design team, would an extra string in the dialog + another one in the help page suffice?
Comment 5 Mike Kaganski 2024-03-04 06:40:40 UTC
IMO, it only needs a note in the Macro Security dialog, like "takes effect on files opened after the change" (colored?) label shown at the moment of a change (similar to "Search key not found" message in Find/Replace dialog). No need in additional dialogs / infobars in documents.

Or an infobar could be an option - like "The macro security settings were changed since opening of this document. They will only be active for the document after a reload. Do that now? [Reload]". But it's an overkill IMO.
Comment 6 Heiko Tietze 2024-03-04 10:12:47 UTC
I dislike the concept of changing a security level to once run an action. We better allow to execute the macro anyway.

The confusion comes from the fact that most options are applied to the document. The function here is "Adjust the security level for executing macros and specify trusted macro developers.". Adding more explanations, eg. what executing a macro means, is not an improvement, IMO.
Comment 7 Mike Kaganski 2024-03-04 10:36:44 UTC
(In reply to Heiko Tietze from comment #6)
> We better allow to execute the macro anyway.

It is not an option. An admin could disallow users; and then the dialog would not allow changing the level, but your "allow to execute the macro anyway" would be a backdoor.

> Adding more explanations, eg. what executing a macro means

No one suggested to explain "what executing a macro means" up to now, it seems.
Comment 8 Heiko Tietze 2024-03-04 10:40:18 UTC
Prototype could be Firefox's “Warning: Potential Security Risk Ahead” bypass [1], which an admin can disable [2] in the expert options.

[1] https://support.mozilla.org/en-US/kb/what-does-your-connection-is-not-secure-mean
[2] https://medium.com/volosoft/how-to-disable-firefox-warning-potential-security-risk-ahead-f081fbf81a4f
Comment 9 Rafael Lima 2024-03-04 11:56:37 UTC
What about we simply reload all opened files right after the security options are changed? This would be invisible to the user and would make the macros work.
Comment 10 Mike Kaganski 2024-03-04 12:10:52 UTC
(In reply to Rafael Lima from comment #9)

I suggest even do it without saving all the unsaved changes ;-P
Comment 11 Eyal Rozenberg 2024-03-09 07:24:03 UTC
(In reply to Rafael Lima from comment #9)
> What about we simply reload all opened files right after the security
> options are changed? This would be invisible to the user and would make the
> macros work.

Invisibility is inappropriate of course (as Mike points out). But - why not give a prompt for reloading documents? That could explain why it may be important to reload. And the user could choose whether they want to (save and) reload everything or nothing (and perhaps individual files? Not sure.)


(In reply to Mike Kaganski from comment #10)
> I suggest even do it without saving all the unsaved changes ;-P

What about prompting the user about a reload?
Comment 12 Mike Kaganski 2024-03-09 07:44:58 UTC
I disagree.

When I work with many documents, and at some point, I open a specific document, and realize that it requires a different security level. I modify the level, and may want to reload that specific file. But I would hate to have a nagging prompt.

The maximal tolerable level of nagging would be an infobar. My preferred solution would be an infotip in the security dialog. No intrusive prompts.
Comment 13 Bdac 2024-03-11 16:33:27 UTC
Maybe, when the user changes the value (ex. set level from High to Low) a confirmation window could ask if it’s really sure to apply the change, and inform at the same time that his validation requires a file reload ?
Comment 14 Cor Nouws 2024-03-13 17:58:00 UTC
(In reply to Bdac from comment #13)
> Maybe, when the user changes the value (ex. set level from High to Low) a
> confirmation window could ask if it’s really sure to apply the change, and
> inform at the same time that his validation requires a file reload ?
Would be a bit more nagging then the following..

(In reply to Mike Kaganski from comment #12)
> The maximal tolerable level of nagging would be an infobar. My preferred
> solution would be an infotip in the security dialog. No intrusive prompts.
which looks fine to me.
Comment 15 Heiko Tietze 2024-03-14 10:11:08 UTC
We discussed the topic in the design meeting.

Both proposals, to show an infobar requesting the user to reload and a label in the macros security option dialog or the restart confirmation box sound like a reasonable solution. In any case we should inform the user about the need to reload.
Comment 16 Commit Notification 2024-03-19 13:49:37 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6178387f7bcc35df9272978ec936f8b53c6da80d

tdf#159985 Warn about the need to reload file after changing macro security level

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 Stéphane Guillou (stragu) 2024-03-20 06:40:56 UTC
Thanks for the patch, Rafael! I think it's a great balance between visibility and unobtrusiveness.

Verified in:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 53c5d570cab036b23f4969b858a648c8f0c24f93
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

In release notes: https://wiki.documentfoundation.org/index.php?title=ReleaseNotes%2F24.8&type=revision&diff=745345&oldid=745086
Comment 18 Commit Notification 2024-03-23 11:40:02 UTC
Stéphane Guillou committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/b010f7c91670f60ab8c637b321507b67d1bc4a63

tdf#159985: need to reload file for macro security change