mantisbt-plugins / Snippets

Define snippets of text that can be easily pasted into text fields
MIT License
8 stars 12 forks source link

{handler} and {project} not working in Reminder textarea #46

Closed syedjh closed 3 years ago

syedjh commented 4 years ago

Hi,

Note: In Note, Description, Steps To Reproduce, Additional Information is working fine as expected but only in Reminder isn't working.

Kindly refer the below-attached screenshot PM tool

dregad commented 4 years ago

Hello and thanks for the bug report. I can confirm the bug.

ibyssorucevap commented 3 years ago

Hello dregad, We have same problem. When you think publish 2.2.6 ? We need this so much. Thank you

dregad commented 3 years ago

There are in fact 2 distinct issues here.

The main problem is that the plugin is not retrieving the _bugid from the Send Reminders form, causing the placeholders to be replaced by a default value instead of the expected one.

The tag {project} it does not show the current project but it is showing All Projects

For the record, it actually does show the current project (when no bug_id is passed to the Snippet::patterns() method, the code calls helper_get_current_project()), but that may not match the project of the issue being displayed.

Fixing this requires updating the JavaScript, so the bug_id is retrieved from the page.

The tag {handler} not working as expected, the tag as it is printed in a textbox.

In addition to the root cause explained above, there is an additional problem, as the placeholder is left as-is if the Issue is unassigned. This affects other Snippets locations, not just the Reminders page. I'll open a separate issue to track this.