Possibility of WYSIWYG in form comment plugin?

Status
Not open for further replies.

Mustafa_s

Member
Hello,

Is it possible to convert the form comment plugin to a WYSIWYG editor instead of the plain editor by default? I know that form elements can be changed to WYSIWYG (where applicable) but how would I go about changing the comment plugin?

Thanks.
 
It would have to coded up in the plugin's model code, and a new layout added.

Although you might be able to do it by just overriding the existing fabrik-form-comment-form.php layout, by borrowing code from around line 311 in the textarea element code.

-- hugh
 
Thanks Hugh.

I looked and compared both files, after burrowing some code I was unable to reach my goal. However, using Firebug I inspected an existing textarea element already inside the form and burrowed the following code:
Code:
class="wfEditor mce_editable source fabrikinput"
I then took that and inserted the class to fabrik-form-comment-form.php on line 7 so it looks as such:
Code:
        <textarea class="wfEditor mce_editable source fabrikinput" style="width:95%" rows="6" cols="3" placeholder="<?php echo FText::_('PLG_FORM_COMMENT_TYPE_A_COMMENT_HERE'); ?>"></textarea>

To which to my surprise, it actually displayed a WYSIWYG editor. As seen in this screenshot (notice the few buttons I have allowed to show/display on top of the textbox) I can insert colored text: Here I stumble upon the issue I'm having now. When I actually click on "Post Comment" I get this error:

I guess I'm really missing the mark on this one, obviously I'm overlooking something but not sure what really.
 
Last edited:
Hugh,

I'm not home at the moment, but as soon as I return I'm getting a subscription. You and the team have more than deserved a subscription, much appreciated.

Thank you, I'll try the changes upon my return as well.
 
Hugh,

I applied the changes from GitHub (only the changes from the comment form plugin) and now it seems like I'm not able to save comments on the form comment plugin. See screenshot, notice how on on Friday (yesterday, before changes) I was able to save changes and today (after github changes) I can no longer save:
 
Last edited:
We don't recommend cherry picking github changes. I know it's a pain, but it's always best to upload everything, as changes in one commit may rely on changes in other files in other commits since you last did a full update. Might not be the problem in this case, but I can't really help unless you are running the same code base as me.

Also ... if you fill in your My Sites, http://fabrikar.com/you/my-sites, I'll take a look. I just need the backend URL and a super admin login, don't need ftp or mysql (yet).

-- hugh
 
Hugh,

I'll keep that in mind going forward. In the meantime, I've created a Super User for you to take a look if you would like. One small thing to keep in mind, the "Message" element has two JavaScript rules to apply ReadOnly attributes to text areas. This element could be unpublished for testing if you would like.
 
Hugh,

That's so strange, I can't pinpoint what is causing that.

When in Incognito mode everything is OK? You can actually login and change the form in Incognito form.

Should I make a clean copy of the live site and port it over this development site? I may have been tinkering too much.
 
Something weird with your site's root folder. On the backend it's just yoursite.com/ but on the front end it's yoursite.com/ddp, but assets are trying to load without the /ddp. And I think you may be using some redirect extension?

-- hugh
 
Hugh,

I took a backup from the live site and restored it to the dev site, the dev site should now work (tested). I added my live site info to my URL list for you to take a look as well, as that may be of use to get this issue solved.

The exact same copy of the site is on both the development and on the live site. On the development site everything is now working as expected - comment form with WYSIWYG working as it should, it also works without WYSIWYG option. But for whatever the reason, on the live site, WYSIWYG option on comment form doesn't work, only the non-WYSIWYG works on the live site. Keep in mind, these two sites are a copy of each other, no changes have been made. The live site is HTTPS and the development site is HTTP, I forced HTTP onto the live site and the WYSIWYG option still doesn't work, only non-WYSIWYG works.

How strange is this huh? In any case, I had to revert back to non-WYSIWYG on the live site so the users can enter comments.

I made identical accounts for you to take a quick glance on both sites. If at all possible, please keep in mind not to make any changes on the live site as users are on it. If you want to see the behaviour of how it's acting on the live site, first enable WYSIWYG option in the backend comment form plugin and then use record 711 in the front-end to try and entering a comment. When done testing, please revert back to non-WYSIWYG for comment form plugin so the users can use it again.

Thanks.
 
I'm seeing the same problem for the comment JS files. Instead of loading the JS, it's rendering a 'blank component' page.

-- hugh
 
Hugh,

Not sure I understand, are you getting the same issue as you previously were (where it redirects you to re-login) after attempting to enter in a comment? If so, which site, dev or live?

I'm not experiencing that on my end anymore. I'm able to login to both dev and live site with many different login accounts (admin and non-admin) and save comments, after having applied the latest github files. The only problem being is that on the live site the WYSIWYG option renders the comment form plugin useless as it wont save the comments, whereas on the dev site it's 100% fine.

Don't think it's cache related as I've turned off caching.
 
Last edited:
Load your live site page with the form on it in Chrome, then open devtools and reload the page. You'll see syntax errors. Look at the content of what is supposed to be the comments-min.js.

-- hugh
 
http://screencast.com/t/VQZAmfaKOiN

As you can see, comments-min.js is a J! page with the blank component in it, not a minified JS file.

The reason it works without WYSIWYG is the plain textarea will still submit without needing JS. If the JS was working, the comments would be 'threaded' and open/close by clicking the reply link, and the WYSIWYG would work.

-- hugh
 
Hugh,

I think I see what you're saying, but how come the replica of the live site works under the dev site? That's so strange to me.

I have no idea how to fix this, I've went ahead and uninstalled "Blank Component" from the live backend. There should be no reference to this component now.

Here is a screenshot of the live site in my console within Chrome (after enabling WYSIWYG):
 
Last edited:
So strange, while using Chrome in Incognito mode I can see the errors, but within a regular chrome session I dont.


It's returning a 404, but I double checked and the files are there on the server where they're supposed to be.
 
Last edited:
I'm out running errands atm so can't test it, but that screenshot looks better. Does WYSIWYG still not work.

Sent from my HTC One using Tapatalk
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top