Hello
I am making my first attempt a using a custom function but am getting an 'INTERNAL APPLICATION ERROR'
This is what I did..
1. I created a new file in the config folder called custom_functions_inc.php
2. I copied the example code into this file for function custom_function_override_roadmap_print_issue from the documentation here : http://www.mantisbt.org/docs/master/en- ... ct.roadmap
My intention was to amend the example code to suit my purposes but I can't get the original code to work !
What am I doing wrong? I am hoping I have made some basic and obvious error that a more experienced user will immediately spot
(I am using the current stable release of MantisBT 2.21.1 running on my own hosted webserver with PHP 7.3.7)
Custom function using example code errors
Moderators: Developer, Contributor
Re: Custom function using example code errors
Trying to find the problem can be cumbersome.
Simple trick is to comment out the lines and then try y uncommenting the lines one by one.
Sometimes it is reall soemthing stupid like a typo
Simple trick is to comment out the lines and then try y uncommenting the lines one by one.
Sometimes it is reall soemthing stupid like a typo
-
- Posts: 4
- Joined: 31 Jul 2019, 20:10
Re: Custom function using example code errors
Thanks cas - I followed your advice and commented out the code a line at a time. Unfortunately the error did not clear until I have commented out the entire function including its declaration - leaving just a <?php in the file
Just having the code
..is enough to cause the error.
I also tried just adding a simple echo 'Test'; to the function so it had a body, also I copied in the code from the custom_function_default_roadmap_print_issue() function in the MantisBT core code.
Stumped !
Just having the code
Code: Select all
<?php
function custom_function_override_roadmap_print_issue( $p_issue_id, $p_issue_level = 0 ) { }
I also tried just adding a simple echo 'Test'; to the function so it had a body, also I copied in the code from the custom_function_default_roadmap_print_issue() function in the MantisBT core code.
Stumped !
Re: Custom function using example code errors
Strange, perhaps documentation is not fully update to latest release.
If you just add:
still an error message?
If you just add:
Code: Select all
<?php
function XXX ($id){
}
-
- Posts: 4
- Joined: 31 Jul 2019, 20:10
Re: Custom function using example code errors
That doesn't cause an error, however this does...
It is indeed, strange ! Whilst the function is specific to the Roadmap the site errors wherever which suggests to me that the very existence of the function, irrespective of its content, is causing a site wide error.
Code: Select all
<?php
function custom_function_override_roadmap_print_issue( $p_issue_id, $p_issue_level = 0 ) {
}
Re: Custom function using example code errors
What do you want the custiom function for?
Give it a logical name refering to its purpose.
Give it a logical name refering to its purpose.
-
- Posts: 4
- Joined: 31 Jul 2019, 20:10
Re: Custom function using example code errors
The custom function is to change the format of entries listed on the Roadmap page so I can tailor this to our specific needs. The function name is dictated by MantisBT as documented here http://www.mantisbt.org/docs/master/en- ... ct.roadmap
Re: Custom function using example code errors
Then I would start with copying the existing function "custom_function_default_roadmap_print_issue" which is located in custom_function_api.php within the core directory.
Change the name according instructions and see if that works as expected. If so, you can make the required changes.
Change the name according instructions and see if that works as expected. If so, you can make the required changes.