Add OJS 3.5 support and a configurable article count#29
Open
edersotto wants to merge 1 commit into
Open
Conversation
- Update to OJS 3.5 APIs: replace CacheManager with Illuminate Cache facade, AppLocale/Services with the Locale facade / Repo, and adjust namespaced imports. - New 'Number of articles' (mostReadCount) setting to control how many items the block shows (defaults preserved when unset). - Harden the block template: escape output and only render when there are results; rename the block CSS class to block_most_read. - PSR-12 formatting; bump version to 3.5.0.1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
|
thanks for this, looked very good with a quick glance. I am on vacation right now, but will merge this soon. I will move 3.4 to a dedicated branch and merge this to master to match the current main release of OJS. This is how I usually do with other plugins as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
This PR brings the Most Read block plugin to OJS 3.5, plus a small feature.
1. OJS 3.5 compatibility
PKP\cache\CacheManagerwith theIlluminate\Support\Facades\Cachefacade.APP\i18n\AppLocale/APP\core\Servicesusage with thePKP\facades\Localefacade and
Repo.These calls target 3.5 APIs, so the branch is meant for the 3.5.x line (it will not run
on 3.4). See the note on branching below.
2. Configurable number of articles
A new "Number of articles" (
mostReadCount) setting lets journal managers choose howmany items the block shows, with validation (whole number ≥ 1). Existing behavior is
preserved when the field is left empty.
3. Template hardening
|escape) and only render the block when there are results(
{if !empty($mostRead)}).block_developed_bytoblock_most_read.4. Housekeeping
settings.count,settings.mostReadCountInvalid,settings.mostReadDaysRequired) added toenandpt_BR.version.xmlbumped to3.5.0.1(copyright header unchanged).A note on branching
The changes require 3.5 and would break 3.4 if merged straight into a 3.4
master.If you'd prefer, I'm happy to retarget this to a
stable-3_5_0branch (or rebase ithowever you cut new OJS lines) — just let me know.
Context / credit
These changes come from work done at OJSBR while adapting the
plugin for OJS 3.5 deployments. Thanks for maintaining Most Read — it's widely used in the
Brazilian OJS community. Happy to iterate on anything here.