mantisbt-plugins/BBCodePlus

Cannot get the toolbar to work (IIS8.5 + PHP Environment)

Closed this issue · 53 comments

I installed BBCodePlus plug-in in my mantis installation, and it works on text areas just fine. I can manually do [ b]some text[ /b] etc and it will show me bold/italic etc.

However I cannot figure out how to get the toolbar to work. But according to the plugin Wiki, it's supposed to show you a toolbar.

This is what my config options look like:

bbcode

Is there a set of steps/installation guide? Otherwise, is there anything else I need to do to get it working.

Here's my mantis and my system information.
OS: Windows Server 2012 R2 (Version 6.2, Build 9200)
IIS Version: 8.5.9600.16384
PHP Version: 7.2.7 (verified that it's working)
Mantis Version: MantisBT 2.19.0
Browser: Google Chrome Version 72.0.3626.121 (Official Build) (64-bit)

Check #31, this might be your issue as well.

Thanks for the reply!

On that note, looks like I haven't installed Markitup. But how do I do that - I didn't find anything here on that? Do I copy it into the same folder as mantis?

Markitup has an installation guide, but I don't know how it would work with Mantis/BBCode Plus?

mark

EDIT:
I checked and have no newline characters in any of my config files.

No man, you don't need to install MarkItUp, it is all included in the plugin. If you are not seeing the tool bar it is likely that the problem is what I pointed out.

I see. So I did check the config files and there are no new lines, and I also did not do any security changes. Is there a list of files I should check?

Can you send a screenshot of a text area (like new issue or comment) to see what it looks like?

This is how it looks like in the 'Create Issue' section. 'Problem Description' is the default 'Summary' filed, I just changed the caption. There's a bunch of additional custom textareas I've created as well and they too look the same.

issuenew

And following is the 'Add New Note' section.

issuenote

One more thing, if in Chrome or Firefox, press F12 and display the developer toolbar. Then make sure you are on the Networking tab and refresh the page....you should see a list pop up:

image

I am interesting on seeing the errors.

Also, I tried some BBCode formatting, the basic ones like bold, italic work but not color.

red

Here's the list you asked for:

nwerror

Hmmm, the status codes seem fine. Let me do some further digging. I assume you are using the latest master version?

Thank you! Please let me know if you find anything.

Yes I downloaded as a zip the latest version from here. Version: 1.x-1.1.15.zip

Also, I tested most of the BBCodes, results below. Some work but some like [img], text color and highlight color, don't seem to work either.

bbtest

Wait, but your screenshots show you have mantis 2.x...? If so, you need to install the version of BBCodePlus for that version of mantis, from the 2.0.x branch:

https://github.com/mantisbt-plugins/BBCodePlus/tree/master-2.0.x

Sorry, that was the Markitup version I typed above, by mistake.

I have the correct BBCode version - 2.0.

And, do I need to install anything else like JQuery/Json etc? I'm working on a pretty bare bones machine that I install things as I go.

Not that I know of. Mantis provides the jQuery stuff. My challenge here will be to replicate your IIS environment, as I (and probably mostly everyone) runs on apache/php. I am curious if that has anything to do with your issue.

OK so this almost certainly to do with my system.

I have a second mantis installation on a different machine, and the plugin works there. It's on Windows 7, and here's a comparison of the two systems. I'm not sure how to narrow down the problem now though.

Win 7 (plugin WORKS)

Windows 7 Professional, SP1 (64 bit)
MantisBT: 2.19.0
PHP: 2.7.2
IIS Version: 7.5.7600.16385

Windows Server 2012 R2 (plugin does NOT work)

Windows Server 2012 R2 Standard (64 bit)
MantisBT: 2.19.0
PHP: 2.7.2
IIS Version: 8.5.9600.16384

On your PHP, I think you may be meaning 7.2.2...

Hence the kicker. You see, nowadays I run all of my web stuff on docker (on linux). You can also run IIS on docker but you have to have a Windows box. And even then it will likely not be a true IIS scenario like what you have on the Win 2012 Server.

Can you go here for a min? Enter whatever name you want.

https://rocketchat.belmankraul.com/livechat

No the PHP version is 7.2.7, please see:

phpver

OK. Per our conversation, I set up my clean environment in order to replicate. I did find some issues with the implementation that have to do with CSP (Content Security Policy). I have found a way to correct this, and I am currently cleaning up for a PR. Hopefully after this, it will either work, or we will have a better idea of what is going on.

@sachintha81 Please check the latest master-2.0.x code. I am hoping this will solve your issue (along with you trying a new environment).

Hey, thanks for the update! Unfortunately though, the problem still persists for me. I installed a fresh copy of Mantis and then this new plugin version, but I still don't get the toolbar.

Capture

Just for kicks...have you tried clearing any cache on the browser you are trying to access your mantis installation from? Like clearing all the storage for the site, or even doing a "Forget this site"?

Yeah did a full clean even including passwords. No luck.

OK I have the installation ready for when you answer my question about root. I did find out that there is now a really neat way to install and maintain php versions on IIS 7+ (Server 2012 comes with 8), called the PHP Manager. I am not sure how you are installing your version of PHP (I followed this guide for IIS7 but most of it also works for IIS8), but I could not find PHP version 7.2.7. The official windows version available from php.net is 7.2.16, and is very easily installable with the PHP Manager module.

I will likely be able to help you with this tomorrow, given that I do have the IIS mantis 2.19 environment ready to install:

image

Let me know.

I was able to replicate the behavior of your issue on my Windows Server 2012 box. It seems it is a path issue when it comes to accessing plugin files, in this case the BBCodePlus intialization file. I am doing more digging. Hopefully will have something soon.

I believe I have found the solution to your problem. The issue is that the plugin system is trying to get file information on any plugin files that are being loaded. I found this as an error on the php eror log:

[14-Mar-2019 11:05:42 America/Chicago] Class 'finfo' not found
C:\inetpub\wwwroot\mantisbt\core\file_api.php

Doing some googling on this, came to find out that that the class finfo exists in the fileinfo PHP extension, which is not enabled by default on a new PHP installation. So, your solution will be to make sure that extension is enabled on the php.ini file by making sure this line exists:

extension=php_fileinfo.dll

and then restart IIS.

Again, this is a breeze if you are using the PHP Manager extension for IIS. Let me know and I can guide you through setting that up.

If this fixes your issue, please let me know so I can close it as resolved.

Sorry for the late reply. Here are answers to your questions:

  1. I initially had mantis in a subdirectory (wwwroot/mantis), and later I also tried directly under wwwroot. It did not work in either case.
  2. I too have PHP manager installed.
  3. I downloaded PHP from Web Platform Installer. You can install it from the following link. You can get PHP 7.2.7 from there.
    https://www.microsoft.com/web/downloads/platform.aspx

I just created me a C:\php\7.2.16 folder and dropped the latest php.net Windows binaries and then enabled it on PHP manager. I guess either way works.

Doing some googling on this, came to find out that that the class finfo exists in the fileinfo PHP extension, which is not enabled by default on a new PHP installation. So, your solution will be to make sure that extension is enabled on the php.ini file by making sure this line exists:

extension=php_fileinfo.dll

Enabling that extension is required to get PHP file uploads to work, so I already have that set up.

I see. Well, on that front, does the php log provide any other error information when you try to log the "Report Issue" page?

I also had to make sure all my composer requires were up to date. Actually, initially I didn't have the vendor folder so I had to do that first. I am sure you did that, because otherwise mantis would not run.

Actually, I haven't been able to get file uploads to work on that machine either. I'm still trying to get a fresh copy of Windows installed there.

But other than that I don't get any errors when I create a new issue.

These are the extensions I have enabled:
image

And here is the plugin functioning.
image

Let me know if you want to talk in the chat. It's not active.

My enabled extensions.

ext

Huh...I seem to have temporarily lost internet at home (where my servers are running). I'll give it a few minutes for it to come back. I generally do have a very dependable link, but we have been having some rough weather lately.

OK no worries, I'll be here all day.

I wonder if this is a problem with IIS8 though; you're testing on IIS 7 right?

No man, my setup is as close as I could get to yours, Windows Server 2012 R2 (IIS 8.5):
image

Then I'll try with your version of PHP, that's the only difference atm?

Yeah. Like I said, I just download the 7.2.16 NTS version (after making sure I have the latest VC15 runtimes), put the files inside folder C:\php\7.2.16, and add the version to the PHP manager.

Livechat is back. 🎧

Still no luck.
Installed v7.2.16 (see PHPInfo below), and then cleared browser cache, restarted IIS, and still the same:

phpinfo

issue

Chat still says Bad Gateway.

That's wild. It is the exact same environment. And as you said, you checked the php error log file when you load the "Report New Issue" page and no errors are logged?

Yes, no errors. I think this system is unsalvageable at this point. Like I mentioned even file uploads aren't working although everything is set the way it should. I think I'll let you know once I attempt on the new system, it should be ready for me soon.

Yeah, I'd try that and see. It definitely seems something is jacked up with the current setup. At least we do know that it is not a Server 2012 issue across the board. Currently trying to restore livechat functionality. Will let know know when it is back on. Sorry for that. Outages do do a number sometimes.

Now Livechat is back for sure, hehe 🎧.

OK, finally it's working!

I installed a fresh copy of Windows Server 2012 R2 on a virtual machine and started from scratch. Here's the configuration.

OS: Windows Server 2012 R2 Standard
IIS Version: 8.5.9600.16384
PHP Version: 7.2.14
MySQL: 8.0.15
MantisBT: 2.19.0
BBCode+ 2.0.18

All formatting except for [img] works.

As you can see the [img] tag doesn't work but honestly I can live with that.
Thanks for all your work on this!

bb1

bb2

@sachintha81: A new version of BBCodePlus has been released with a brand new parser system that should address your issue with images not being displayed, along with many other enhancements and fixes. This version is for MantisBT 2.x.

You are welcome to download it here.

Works great, including the [img] tag. Thanks!