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

Reinstate helper_alternate_class() function #234

Merged
merged 5 commits into from Nov 8, 2014

Conversation

dregad
Copy link
Member

@dregad dregad commented Jul 17, 2014

Following the discussion in www.mantisbt.org/bugs/view.php?id=17437, this restores the helper_alternate_class() function previously removed by dhx.

The purpose is to avoid errors with plugins relying on this function following the upgrade.

To facilitate plugin authors' efforts in updating their code to use CSS for table row colors alternation, the function now triggers a deprecated warning.

Since displaying inline errors from within an html tag will mess with the output, a mechanism has been implemented to delay the printing of such errors, which are displayed in a block at the bottom of the page.

@rombert
Copy link
Member

rombert commented Jul 17, 2014

+1

@grangeway
Copy link
Contributor

-1 to this - we should block plugins from being loaded if they are designed for a different version of Mantis:

We need to ensure that plugins are only loaded if they have been updated for the release of Mantis they are on.

So for example, if a plugin is designed for 1.2, it should work on 1.2.X releases ideally

But a plugin designed for 1.2 shouldn't load in 1.3 - in some cases there are Database changes or other changes that may require a user to update their plugin. Allowing a plugin designed for a completely different version of Mantis to run in a new version could lead to un-intended consequences (especially given the scope of changes between 1.2 and 1.3)

We started discussing this previously in http://www.mantisbt.org/bugs/view.php?id=17360

@dregad
Copy link
Member Author

dregad commented Aug 8, 2014

we should block plugins from being loaded if they are designed for a different version of Mantis

This is now implemented in PR #239.

However, since 1.3 is supposed to be a non-breaking (minor) version, I still think that this should be merged (with the deprecated warning), and the function killed in 2.x.

@dregad
Copy link
Member Author

dregad commented Aug 8, 2014

@vboctor your feedback on this would be appreciated

@vboctor
Copy link
Member

vboctor commented Sep 20, 2014

I actually think having this deprecated method makes sense. It will enable us to make it obvious for ourselves and plugin developers when there are methods that are about to be deprecated and shouldn't be used. Even with the other pull request, we may still have plugins that specify a range and would benefit from this information.

I would expect this new error type would show in config_defaults_inc.php / manual as appropriate. Ideally the version range formats would also show in the developer's manual (though that is not part of this pull request).

+1.

@vboctor
Copy link
Member

vboctor commented Nov 2, 2014

@dregad this PR is marked as one of the issues blocking 1.3, can you please finalize/merge.

@dregad
Copy link
Member Author

dregad commented Nov 3, 2014

Will do.

Need to open an issue to track the introduction of DEPRECATED error type.
==> http://www.mantisbt.org/bugs/view.php?id=17837

Note to self: update commit message to reflect new bug ID. Also add #17522 to 4bd7006

This is a temporary measure to improve backwards compatibility of 1.3,
the function will be removed again in the next release.

Fixes #17522 (see also issue #17437)
Make use of E_USER_DEPRECATED instead of relying on WARNING for
deprecated functionality. Allows for differentiated error messages and
handling.

Fixes #17837
This avoids display errors when a deprecated warning is triggered from
within an HTML tag, as was the case when using helper_alternate_class().
@dregad
Copy link
Member Author

dregad commented Nov 8, 2014

Rebased in preparation for merge

@dregad
Copy link
Member Author

dregad commented Nov 8, 2014

Here's how things looks like for a plugin relying on helper_alternate_class:

  • rows colors alternate
  • deprecated warnings are displayed at page bottom (only with $g_display_errors set to display them inline)

selection_002

@dregad dregad merged commit 09c301f into mantisbt:master Nov 8, 2014
dregad added a commit that referenced this pull request Nov 8, 2014
@dregad dregad deleted the helper_alternate_class branch November 23, 2014 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants