Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugreport - conflicting messages in the banner: "showApproved() message" is shown in the banner of "previous approved version" #155

Open
Chris75forumname opened this issue Jul 20, 2021 · 0 comments

Comments

@Chris75forumname
Copy link

Chris75forumname commented Jul 20, 2021

Hi,

When a "previous approved version" is shown, the banner shows a second line with the "showApproved() message", which is in a sense a true statement, but, contradictary to the message in the next line, stating, "This is an old revision of the document!" (lang/showrev.txt). Also it is flagged green, which is misleading, since this document should not be used anymore.

The bug is a missing condition in the header (if condition) of the "showApproved() function". I think, the condition:

if (!$this->hlp->isCurrentRevisionApproved()) {
return;
}

is too weak and causes the undesired conflicting message in the banner of the "previous approved version".
If I replace it by the following stronger condition in the header of the "showApproved() function":

global $ID;
$revision = $this->hlp->getRevision();
$latestApprovedRevision = $this->hlp->getLatestApprovedRevision();
if ($latestApprovedRevision != $revision) {
return;
}

(which was taken (and modified) from the "showLatestApprovedVersion() function"), I get the desired behaviour, which is:

  • the "showApproved() message" is STILL shown for the "latest approved version"
  • the "showApproved() message" is NOT shown for the "previous approved version"

That was my bug report for the publish plugin, which I think is great!
Thank you alot for maintaining it! Thumbs up! Christian

@Chris75forumname Chris75forumname changed the title Bugreport - conflicting messages in the banner (showApproved()-Message is shown with previous approved version) Bugreport - conflicting messages in the banner - showApproved()-Message is shown with previous approved version Jul 21, 2021
@Chris75forumname Chris75forumname changed the title Bugreport - conflicting messages in the banner - showApproved()-Message is shown with previous approved version Bugreport - conflicting messages in the banner: "showApproved() message" is shown in the banner of "previous approved version" Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant