Describe the issue or problem
I have developed years ago a plugin that extracts an html, and appends it to the main article_details tpl, inserting figures and tables inline.
I have never published this plugin, as it is heavily customized, and still somewhat works in progress.
Now I am updating this to 3.4, and ultimately, 3.5. So far it works on 3.4, but there were a lot of changes in 3.3 → 3.4, including in the templates and Smarty themselves.
We haven’t fully rolled out the Repository pattern, which was described in the 3.4 Release Notebook, to all use cases – so some service classes still remain, including the file service.
In 3.5, the way to get the service changed as we replaced the Pimple container (a 3rd party library) with Laravel’s dependency injection tools. This is noted in the 3.5 Release Notebook, which links to #9913 where that particular change was coded.
In short, starting with 3.5, you can get the file service by using app()->get('file') instead of Services::get('file'). You can see a concise example of the change in this PR for the JATS template plugin.
Since you’re asking about future-proofing – I don’t suggest trying to maintain a single plugin codebase that’s cross-compatible with different major branches; instead, I’d recommend creating a branch for each, along the same lines that we do for OJS/OMP/OPS (stable-3_3_0, stable-3_4_0, and stable-3_5_0). If you have to make a change to all 3 branches, you can generally cherry-pick between branches then test.
Regards,
Alec Smecher
Public Knowledge Project Team