Bug 60883 - Macros: macros allways disabled in files created from templates when working via Templatemanager: File > New > Template
Summary: Macros: macros allways disabled in files created from templates when working ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: All All
: medium major
Assignee: Noel Power
URL:
Whiteboard: BSA bibisected40 target:4.2.0 target:...
Keywords: regression
Depends on:
Blocks: mab4.0
  Show dependency treegraph
 
Reported: 2013-02-15 09:37 UTC by mindaugas.rucys
Modified: 2015-12-22 01:31 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test template with macro (10.69 KB, application/vnd.oasis.opendocument.text-template)
2013-03-04 08:43 UTC, Cor Nouws
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mindaugas.rucys 2013-02-15 09:37:07 UTC
Problem description: When you create a file from template containing macros, macros are always disabled no matter what settings are in macros security.

Steps to reproduce:
1. Set low macros security  (Tools-Options-Libreoffice-Security-Macro Security  set Low or Medium)
2. Restart Libreoffice 
3. File-New-Templates and choose template containing macros (I test with ott and ots files)

Current behavior: All macros are disabled no matter what security level - Low or medium is selected. If you save the new file and open again, the problem disappear.

Expected behavior: The macros in new file created from template would do according security settings - for medium level it should appear the dialog asking enable macros or not, for low level macros should be enabled.

              
Operating System: Debian
Version: 4.0.0.3 release
Last worked in: 3.5.4 release
Comment 1 Cor Nouws 2013-03-04 08:43:15 UTC
Created attachment 75887 [details]
test template with macro

@mindaugus

thanks for reporting.
However I cannot reproduce this on Ubuntu 
(tried with LibreOffice 401 rc2)

I saved a file with macro as template, and simply start a new document from that file from the filemanager.
Witn seciruty Low or Medium, I both get access to the macro.

Attached my simple test file
Comment 2 mindaugas.rucys 2013-03-04 15:40:57 UTC
Yes, if I open template from file manager, I get access to macro, the problem appear only when I create new file from Libreoffice menu - "File"-"New"-Templates"
Comment 3 Christian Prim 2013-03-09 20:00:23 UTC
I can reproduce this Bug on MacOSX. My Version:
4.0.1.2 (Build ID: 84102822e3d61eb989ddd325abf1ac077904985)
TinderBox: MacOSX TDF Release, Branch:libreoffice-4-0, Time: 2013-02-27_17:15:43
Comment 4 Joel Madero 2013-03-19 15:13:46 UTC
Thank you for reporting this issue! I have been able to confirm the issue on:
Version 4.1.0.0.alpha0+ (Build ID: b514f0ce86e85d9be269ddf2e797befbbf3423f)
Date:   Thu Mar 7 21:46:30 2013 +0200 
Platform: Bodhi Linux 2.2 x64

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
As I've been able to confirm this problem I am marking as:

New (confirmed)
Normal - can prevent high quality work if user does not know about workaround (opening directly from file browser). Opening from template manager leaves macro unusable 
Medium (despite there being a workaround, this is a regression and thus deserves some attention)

Keywords - regression (works fine in 3.6.5.2)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LibreOffice is powered by a team of volunteers, every bug is confirmed (triaged) by human beings who mostly give their time for free. We invite you to join our triaging by checking out this link:
https://wiki.documentfoundation.org/QA/BugTriage and join us on freenode at #libreoffice-qa

There are also other ways to get involved including with marketing, UX, documentation, and of course developing -  http://www.libreoffice.org/get-help/mailing-lists/. 

Lastly, good bug reports help tremendously in making the process go smoother, please always provide reproducible steps (even if it seems easy) and attach any and all relevant material
Comment 5 Joel Madero 2013-03-19 16:49:08 UTC
 eb01a04acbb7373331312a2ee3d9d90d20548fca is the first bad commit
commit eb01a04acbb7373331312a2ee3d9d90d20548fca
Author: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
Date:   Tue Dec 11 09:32:19 2012 +0000

    source-hash-ce90f99a2d66c2b998ad3f9f028e2ea623a757f5
    
    commit ce90f99a2d66c2b998ad3f9f028e2ea623a757f5
    Author:     Luboš Luňák <l.lunak@suse.cz>
    AuthorDate: Sun Dec 2 22:35:57 2012 +0100
    Commit:     Luboš Luňák <l.lunak@suse.cz>
    CommitDate: Mon Dec 3 18:04:24 2012 +0100
    
        fixes for where fast string operator+ is not perfectly source compatible
    
        Change-Id: I80af0399037e4f68113338139e7f2ad2400e65ab

:100644 100644 d6a3e35f1dc57a7469408bdb1aaa587ba6cf3cfe b4973c1d86cfd5c0d550e84e7e483802d979829e M	ccache.log
:100644 100644 a2d3790ddaa245f4d56968133ce5be440af2c033 a0e5b02e554537a0bed70a3203ca3995bb6972bd M	commitmsg
:100644 100644 3fad2a60908b6b6bc1de0af560f7239a89b54e73 6ba1538977f3fb5b8f0ee54bbd04be28afdd85e3 M	dev-install.log
:100644 100644 2df1def8f8a08f16f92540ae4eab28de4984a88f dc4842a6e74513bbe562bb0d78a1ed545ead53e7 M	make.log
:040000 040000 0dc3db85f8784d986d2364a0972044d502c2a5e3 e70233c1668fc1da017a420ac2ed5ee366e253ad M	opt



# bad: [5b4b36d87517a6ea96ff8c84c46b12f462fc9a1a] source-hash-8450a99c744e9005f19173e4df35d65640bcf5c4
# good: [65fd30f5cb4cdd37995a33420ed8273c0a29bf00] source-hash-d6cde02dbce8c28c6af836e2dc1120f8a6ef9932
git bisect start 'latest' 'oldest'
# good: [16b0b88cbd4ef0f51816e97277e40c5cf78f7bf9] source-hash-099198a4224778fe6e43f5dc13b5b9b1b4dc828c
git bisect good 16b0b88cbd4ef0f51816e97277e40c5cf78f7bf9
# good: [f28b8f9a6c47fa59bf98fffe937a2f2db7a2445a] source-hash-a581d31b227623e09d2970a91214fda398f98eda
git bisect good f28b8f9a6c47fa59bf98fffe937a2f2db7a2445a
# good: [114fd3b76bcba890e6d702d00cef910f1493c262] source-hash-64ab96cd15e52da88781e720d6f031dbcd0ba902
git bisect good 114fd3b76bcba890e6d702d00cef910f1493c262
# good: [47498a36f7af8f54e6e3dda89cd4708802a409e6] source-hash-19f4ebd8a54da0ae03b9cc8481613e5cd20ee1e7
git bisect good 47498a36f7af8f54e6e3dda89cd4708802a409e6
# good: [66083171ba534818399937597388d325091fffab] source-hash-9d83ad0e99ab182506be99f7d6a2bec7f6fbe8c6
git bisect good 66083171ba534818399937597388d325091fffab
# good: [8407d6926d9fa83ebbd8e03de319ea63df131753] source-hash-3d4288c1c0b593421c7f6619c88584bdb7c53337
git bisect good 8407d6926d9fa83ebbd8e03de319ea63df131753
# bad: [eb01a04acbb7373331312a2ee3d9d90d20548fca] source-hash-ce90f99a2d66c2b998ad3f9f028e2ea623a757f5
git bisect bad eb01a04acbb7373331312a2ee3d9d90d20548fca
# good: [f53a1835f8b1fefbaf0d4dd8e9eaa4232bb246af] source-hash-4026e1824de8ff9b5d006ae6eba491f91bc4e599
git bisect good f53a1835f8b1fefbaf0d4dd8e9eaa4232bb246af
Comment 6 Richard 2013-03-20 21:05:03 UTC
Hello,

I can confirm this bug also occurs on WinXP SP3 and LO 4.0.1.2

Macro runs when using Windows file manager.

Macro does not run when using Template Manager.

Have Template directory in the Trusted File Locations.

Have tried all 4 Security Levels.
Comment 7 Richard 2013-05-11 21:14:32 UTC
This bug no longer appears in LO 4.0.2 and LO 4.0.3
Comment 8 Joel Madero 2013-05-11 23:12:53 UTC
Due to last comment, WFM
Comment 9 mindaugas.rucys 2013-05-13 12:16:30 UTC
The bug stil exist (Debian unstable (LO 4.0.3.3), Arch Linux (LO 4.0.3-1), Ubuntu 13.04 (LO 4.0.2))
Comment 10 Joel Madero 2013-05-14 04:36:39 UTC
Changing back to NEW - reopened is only for a bug that has a developer assigned to it. Thanks for reporting back
Comment 11 mindaugas.rucys 2013-07-15 18:52:28 UTC
The bug still exist LO 4.1.0 RC2-1 Debian (experimental)
Comment 12 Noel Power 2013-07-31 10:18:41 UTC
I'll take a look at this
Comment 13 Noel Power 2013-07-31 14:43:09 UTC
(In reply to comment #12)
> I'll take a look at this

   jesus wept just spend most of the day chasing the code around the sfx spaghetti :-/ ok think I have a viable fix
Comment 14 Commit Notification 2013-07-31 14:57:43 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4bc42b6d7140144f5e17528276e8ddc80c033d6d

fix for fdo#60883 ( macros disabled for documents opened from templates )



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2013-07-31 15:41:15 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d125339986db266025faa344f87a89bb34a9901b&h=libreoffice-4-0

fix for fdo#60883 ( macros disabled for documents opened from templates )


It will be available in LibreOffice 4.0.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2013-07-31 15:50:42 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c32feb2921aec20c017c63d62269482c483f81d5&h=libreoffice-4-1

fix for fdo#60883 ( macros disabled for documents opened from templates )


It will be available in LibreOffice 4.1.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 17 Robinson Tryon (qubit) 2015-12-22 01:31:30 UTC
Removing comma from Whiteboard (please use a space to delimit values in this field)
https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Whiteboard#Getting_Started
[NinjaEdit]