Bugzilla – Attachment 164381 Details for
Bug 35716
Duplicated assets in both koha-tmpl/intra-tmpl and koha-tmpl/opac-tmpl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35716: PoC
Bug-35716-PoC.patch (text/plain), 2.19 KB, created by
Pedro Amorim
on 2024-04-03 14:22:52 UTC
(
hide
)
Description:
Bug 35716: PoC
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-04-03 14:22:52 UTC
Size:
2.19 KB
patch
obsolete
>From e29753d01bff70064c8cfeaf245f8017e1289404 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Wed, 3 Apr 2024 14:17:57 +0000 >Subject: [PATCH] Bug 35716: PoC > >**K-T-D TEST ONLY** >At /kohadevbox/koha, run the following: >- sudo cpan File::Copy::Recursive >- sudo rm -rf /usr/share/koha >- sudo perl Makefile.PL # press Enter on all prompts >- sudo make install >- find /usr/share/koha -name hello.js >Notice the output: >/usr/share/koha/opac/htdocs/opac-tmpl/js/hello.js >/usr/share/koha/intranet/htdocs/intranet-tmpl/js/hello.js > >My first attemp was using the file_map that is used to PM >but I failed. Even changing the code to allow for multiple targets >in the file_map, the WriteMakefile will always only map 1 to 1 >from the PM hashref. But PL_FILES allows for an array of destinations >given one source. > >This patch needs more work as a SHARED_TMPL_DIR env variable >would be ideal, amongst other improvements, but this is just a proof of >concept to have others look at and see if they agree with this approach. >--- > Makefile.PL | 4 ++++ > build-from-shared-tmpl.PL | 7 +++++++ > koha-tmpl/shared-tmpl/js/hello.js | 0 > 3 files changed, 11 insertions(+) > create mode 100644 build-from-shared-tmpl.PL > create mode 100644 koha-tmpl/shared-tmpl/js/hello.js > >diff --git a/Makefile.PL b/Makefile.PL >index a1ff82673d0..0c905f70f67 100644 >--- a/Makefile.PL >+++ b/Makefile.PL >@@ -694,6 +694,10 @@ my $pl_files = { > 'fix-perl-path.PL' => [ # this script ensures the correct shebang line for the platform installed on... > 'blib' > ], >+ 'build-from-shared-tmpl.PL' => [ >+ 'blib/OPAC_TMPL_DIR', >+ 'blib/INTRANET_TMPL_DIR' >+ ], > }; > > push @{ $pl_files->{'rewrite-config.PL'} }, ( >diff --git a/build-from-shared-tmpl.PL b/build-from-shared-tmpl.PL >new file mode 100644 >index 00000000000..de28f2a2e21 >--- /dev/null >+++ b/build-from-shared-tmpl.PL >@@ -0,0 +1,7 @@ >+use strict; >+use Modern::Perl; >+use File::Copy::Recursive qw(dircopy); >+ >+my $basedir = (shift); >+ >+dircopy( './koha-tmpl/shared-tmpl', $basedir ) or die("$!\n"); >diff --git a/koha-tmpl/shared-tmpl/js/hello.js b/koha-tmpl/shared-tmpl/js/hello.js >new file mode 100644 >index 00000000000..e69de29bb2d >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35716
: 164381 |
174481
|
174482
|
174483
|
174484