- How to Report a Bug
- The basics: what you did, what you wanted to happen, and what actually happened.
- Always search the bug database first.
- If you don’t understand an error message, ask for help.
- Be brief, but don’t leave any important details out.
- Use English.
- Don’t report bugs about old versions.
- Only report one problem in each bug report.
- Check out these other resources.
- Mantis Bug Tracker — Forums
- Call bug_report_page.php with query params to pre-fill form?
- Call bug_report_page.php with query params to pre-fill form?
- Re: Call bug_report_page.php with query params to pre-fill form?
- Re: Call bug_report_page.php with query params to pre-fill form?
- Re: Call bug_report_page.php with query params to pre-fill form?
- Re: Call bug_report_page.php with query params to pre-fill form?
- Re: Call bug_report_page.php with query params to pre-fill form?
- Re: Call bug_report_page.php with query params to pre-fill form?
- Bug report page php
- Tagged as
- Stats
- Comments and Discussions
How to Report a Bug
There is a large number of PHP users. There is a much smaller number of people who actually develop the PHP language and extensions. There is an even smaller number of people who actively fix bugs reported by users.
What does this mean for you, an aspiring bug reporter? In order to catch the eye of one of these few stalwart volunteers, you’ll need to take to heart a few tips on how to report a bug so that they can and will help you.
Take special note of that word in bold above. The people who are going to help you with a bug you report are volunteers. Not only are you not paying them to help you, but nobody else is either. So, to paraphrase the immortal words of Bill and Ted, «be excellent to them».
Beyond that golden rule, what follows are some additional tips on ways to make your bug report better so that someone will be able to help you.
The basics: what you did, what you wanted to happen, and what actually happened.
Those are the three basic elements of a bug report. You need to tell us exactly what you did (for example, «My script calls make_happy_meal(‘hamburger’,’onion rings’)») , what you expected to have happen (to continue the example, «I expected PHP to serve me a happy meal with a hamburger and onion rings»), and what actually happened («It gave me a happy meal with french fries.»).
Yes, the example is silly. But if your bug report simply said «The make_happy_meal function doesn’t work,» we wouldn’t be able to say «That’s because you can’t have onion rings in a happy meal, you can only have french fries or curly fries.» By telling us what you asked for, what you expected to get, and what you actually got, we don’t have to guess.
Always search the bug database first.
Advice is so good, we’ll repeat it twice. Always search the bug database first. As we said above, there’s a lot of users of PHP. The odds are good that if you’ve found a problem, someone else has found it, too. If you spend a few minutes of your time making sure that you’re not filing a duplicate bug, that’s a few more minutes someone can spend helping to fix that bug rather than sorting out duplicate bug reports.
If you don’t understand an error message, ask for help.
Don’t report an error message you don’t understand as a bug. There are a lot of places you can ask for help in understanding what is going on before you can claim that an error message you do not understand is a bug.
(Now, once you’ve understood the error message, and have a good suggestion for a way to make the error message more clear, you might consider reporting it as a feature request.)
Be brief, but don’t leave any important details out.
This is a fine line to walk. But there are some general guidelines:
- Remember the three basics: what you did, what you expected to happen, and what happened.
- When you provide code that demonstrates the problem, it should almost never be more than ten lines long. Anything longer probably contains a lot of code that has nothing to do with the problem, which just increases the time to figure out the real problem. (But don’t forget to make sure that your code still demonstrates the bug you’re reporting and doesn’t have some other problem because you’ve accidentally trimmed out something you thought wasn’t important but was!)
- If PHP is crashing, include a backtrace. Instructions for doing this can be found here for *NIX users and here for Windows users.
- Valgrind log can be also very useful. See instructions how to generate it.
Use English.
Yes, the PHP user and developer communities are global and include a great many people who can speak a great many languages. But if you were to report a bug in a language other than English, many (if not most) of the people who would otherwise help you won’t be able to. If you’re worried about your English skills making it difficult to describe the bug, you might try asking for help on one of the non-English mailing lists.
Don’t report bugs about old versions.
Every time a new version of PHP is released, dozens of bugs are fixed. If you’re using a version of PHP that is more than two revisions older than the latest version, you should upgrade to the latest version to make sure the bug you are experiencing still exists.
Note that PHP branches which are no longer actively supported will receive fixes for critical security issues only. So please do not report non-security related bugs which do not affect any actively supported PHP branch.
Only report one problem in each bug report.
If you have encountered two bugs that don’t appear to be related, create a new bug report for each one. This makes it easier for different people to help with the different bugs.
Check out these other resources.
Mantis Bug Tracker — Forums
Call bug_report_page.php with query params to pre-fill form?
Call bug_report_page.php with query params to pre-fill form?
Post by GeoffM » 16 Dec 2022, 03:37
Is there a way to call bug_report_page.php (to submit a new ticket) with URL query parameters in order to pre-fill certain fields? Often a user will report an issue with our software via our forum and then an administrator has to separately go into Mantis and copy relevant details from the post. It would be nice if our forum software could have a button for administrators which calls a URL to have some of those details already set up. I don’t think we can use the REST API as we don’t have data for the mandatory fields.
Something like [a href=»hxxps://mantis.mywebsite.com/bug_report_page.php?summary=the_forum_posts_title&additional_information=forum_post_id_12345″]
I suspect we could write a new PHP page/file which interfaces to the bug_report_page.php logic somehow, preferably without touching the official Mantis code at all, but just wondering if there already is a feature like this that I’ve missed.
Re: Call bug_report_page.php with query params to pre-fill form?
Post by cas » 16 Dec 2022, 07:45
There is a development to introduce a simple screen issue entry where your customers only have to fill in a minimal data set. Then customers are more willing to use that form and you would not need anything else.
If you are interested I can share a few screenshots
atrol Site Admin Posts: 8209 Joined: 26 Mar 2008, 21:37 Location: Germany
Re: Call bug_report_page.php with query params to pre-fill form?
Post by atrol » 16 Dec 2022, 08:49
GeoffM wrote: ↑ 16 Dec 2022, 03:37
Something like [a href=»hxxps://mantis.mywebsite.com/bug_report_page.php?summary=the_forum_posts_title&additional_information=forum_post_id_12345″]
https://www.mantisbt.org/bugs/bug_report_page.php?summary=Hello&additional_info=Additional
There are also configuration parameters, check the Amdin Guide for that, e. g. there is $g_default_bug_additional_info (and some more)
Re: Call bug_report_page.php with query params to pre-fill form?
Post by GeoffM » 16 Dec 2022, 17:55
cas wrote: ↑ 16 Dec 2022, 07:45 There is a development to introduce a simple screen issue entry where your customers only have to fill in a minimal data set. Then customers are more willing to use that form and you would not need anything else.
If you are interested I can share a few screenshots
Ooh, sounds interesting. I’m very wary of customers submitting nonsense though, whether maliciously or «not a bug». Do these issues go into a kind of holding pattern until a proper use comes along and either approves or rejects them?
Re: Call bug_report_page.php with query params to pre-fill form?
Post by GeoffM » 16 Dec 2022, 17:58
GeoffM wrote: ↑ 16 Dec 2022, 03:37
Something like [a href=»hxxps://mantis.mywebsite.com/bug_report_page.php?summary=the_forum_posts_title&additional_information=forum_post_id_12345″]
https://www.mantisbt.org/bugs/bug_report_page.php?summary=Hello&additional_info=Additional
There are also configuration parameters, check the Amdin Guide for that, e. g. there is $g_default_bug_additional_info (and some more)
Oh, maybe I should have just tried it! I did flick through the Developer guide but not the Admin guide. Thanks, sounds like it’s what I want!
Re: Call bug_report_page.php with query params to pre-fill form?
Post by cas » 17 Dec 2022, 09:24
GeoffM wrote: ↑ 16 Dec 2022, 17:55 Ooh, sounds interesting. I’m very wary of customers submitting nonsense though, whether maliciously or «not a bug». Do these issues go into a kind of holding pattern until a proper use comes along and either approves or rejects them?
One could ensure they first get into a special project where someone can judge the reported issues before they are taken too seriously
Re: Call bug_report_page.php with query params to pre-fill form?
Post by cas » 17 Dec 2022, 10:00
By the way, you could also use the email_reporting plugin. One of the features is doing something similar
All reported so-called issues go into a project from where you can do your review.
- MantisBT — English
- ↳ Announcements
- ↳ General Discussion
- ↳ Help
- ↳ Customizations
- ↳ Plugins
- ↳ General Plugin Discussion
- ↳ EmailReporting
- ↳ Mylyn Connector
- MantisBT — International
- ↳ Deutsch
- ↳ French
- ↳ Russian
Powered by phpBB® Forum Software © phpBB Limited
Bug report page php
Tagged as
Stats
Comments and Discussions
Anyway, great way to track bugs, thank you for amazing article, I use it for years.
new SQLite3('bugs.db'); //Save new bug if(!empty($_POST))< $program=SQLite3::escapeString(stripslashes($_POST['program'])); $error=SQLite3::escapeString(stripslashes($_POST['error'])); $text=SQLite3::escapeString(stripslashes($_POST['text'])); $db3->query("INSERT INTO bugs ( Program , Date , Error , Text ) VALUES ( '$program' , ".time()." , '$error' , '$text' ) "); echo 'ok'; $db3->close(); return; > //Show bug details for rss if(isset($_GET['id']) && is_numeric($_GET['id']))< $bugs = $db3->query("SELECT * FROM bugs WHERE ROWID="); $bug=$bugs->fetchArray(SQLITE3_ASSOC) ?> 'Error in %s: %s',$bug['Program'],$bug['Error']) ?>h1> 'Send at %s',date('d/m/y H:i:s',$bug['Date'])) ?>h3>'Text'] ?>p> close(); return; > if(isset($_GET['clear']))//Clear all bugs $db3->query("DELETE FROM bugs;"); echo 'ok'; $db3->close(); return; > //Show rss $bugs = $db3->query("SELECT ROWID,* FROM bugs ORDER BY Date DESC LIMIT 100"); //$bugs=sqlite_query($bd,"SELECT ROWID,* FROM bugs ORDER BY Date DESC LIMIT 100"); header('Content-Type: application/rss+xml; charset=UTF-8'); $xml=new XMLWriter(); $xml->openMemory(); $xml->startDocument('1.0','UTF-8'); $xml->startElement('rss'); $xml->writeAttribute('version', '2.0'); //Write channel data $xml->startElement('channel'); $xml->writeElement('title','Bugs'); $xml->writeElement('ttl','120'); //Write rss items while($bug=$bugs->fetchArray(SQLITE3_ASSOC))< $link='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'?id='.$bug['rowid']; $xml->startElement('item'); $xml->writeElement('title',sprintf('Error in %s: %s',$bug['Program'],$bug['Error']) ); $xml->writeElement('link',$link); $xml->writeElement('description',$bug['Text']); $xml->writeElement('pubDate',date('r',$bug['Date'])); $xml->writeElement('guid',$link); $xml->endElement(); > $xml->endElement();//End channel $xml->endElement();//End rss echo $xml->outputMemory(true); $db3->close(); //sqlite_close($bd); ?>
thank you for great article, this is the way of bug-reporting, I’ve always been looking for!
I just want to ask, would it be possible to send also ‘\n’ — next line and maybe ‘\t’ — tab somehow? Because the reports are not that easy to read like this. I’m not experienced in php and rss at all, but would it be possible to generate the message as some html code?
Thank you again for great job !
You can send the text parameter as HTML code, in fact this would be the ideal choice. The RSS reader would show the error log well-formatted and readable.
For example, you can do this:
postData.Add("text", error.ToString().Replace("\n","
"));
To preserve the original line breaks
YES! That’s it .. thank you. In my opinion, one of the most important articles for C#(.NET) developers, who try to distribute their products to customers.
Mark Paint.
Education is the ability to listen to everything without losing your temper and self-confidence.
sorry, but my English is very poor and I can’t write a good technical text
Yes, but you can wrap the code with a try block and show an error or simply ignore the exception
I like PHP because it is installed on most web servers and is a free solution
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.