This question about Using an extension: Answered

Comment plugin any default type not working.

I am trying to add comment boxes using the comment plugin. But it doesn't seem to work in sandbox after insallation. Even when I click on the CommentPluginExamples, on my site its a bunch of text rather than actual boxes.

Not srue whats wrong here.

-- ChristyFernando - 13 Dec 2012

Addition to this. I was wondering if anyone can asky why if i put hidden comments in () it also just shows up as text isntead of not showing up at all.

-- ChristyFernando - 13 Dec 2012

Oh wow... <-- with exclamation for hidden acutally got hidden here lol. Which doesnt happen on my foswiki.

-- ChristyFernando - 13 Dec 2012

Are there errors in your InstalledPlugins page? Is CommentPlugin enabled?

Regarding HTML comments, be really careful about how / where they are used. Nesting of comments is not permitted by HTML, and nesting, even accidentally when expanded by a macro, can really break things badly.

-- GeorgeClark - 14 Dec 2012

Looking at the installed Plugins, there is no error on the plugin diagnostic charts.

The only thing I see is this:

afterAttachmentSaveHandler DBCachePlugin This handler is deprecated - please check for updated versions of the plugins that use it!

Other than that the CommentPlugin is enabled in configure. Also I am not really trying to do anything fancy with the comments. But I am not sure why its not working on my site and it is here whenever i create a topic and do

-- ChristyFernando - 14 Dec 2012

sorry add a comment it just disappeared there.

-- ChristyFernando - 14 Dec 2012

I have no idea at this point. Is your site public that we could look at the issue remotely? Can you try the comment with all non-default plugins disabled? Can you look at the target topic with ?raw=on to see if the comments are there, but hidden because of html comments or some other rendering issue?

-- GeorgeClark - 15 Dec 2012

Hi George. So if I look at the raw. of a sample topic in sandbox where I try to use comment box and hidden text it looks like this.
&lt;!--not suppose to show--&gt;<br /><br />
-- Main.ChristyFernando - 13 Dec 2012

Another thing I just realized is that using "verbatim" and "/verbatim" with things in between is not being interpreted properly either. Rathat I have to highlight the text I want and then it will show up as required.

I guess for the hidden comments its definitely not being interpreted. Not sure about the comment box.


Feels like this plugin just refuses to work. I have tried so many ways of setting defaults in WebPreferences and everytyhing..but Nothing seems to bring up the box.

-- ChristyFernando - 17 Dec 2012


This thing refuses to work. Is there any other place where there are settings that I am missing out?

-- ChristyFernando - 17 Dec 2012

All I can think of is someone has set some settings that disable the plugin. This plugin is totally fundamental to so much of Foswiki. I've never run into it not working like this. It's used here to comment on support quesions, it's used in many many places. Other than this I just have no idea.

-- GeorgeClark - 18 Dec 2012

Interestingly enough. With the debug mode, with CommentPlugin, it actually disappears and reappears when disabling / enabling using the debug mode. ie:
%COMMENT% <---appears after disabling, and reappears if its on the debug list.

New error that has popped up is:
/var/lib/foswiki/data/Sandbox/CompareRevisionsAddOnDemoTopic.txt not readable not writable
which is odd because apache owns all the files. This happened only AFTER updating the addon from 1.1.7 to 1.1.8?

-- ChristyFernando - 18 Dec 2012


Shedding more light into the situation. Looking at the error logs I see this:
2012-12-18T18:43:22Z warning Foswiki::Plugins::CommentPlugin::Comment Could not read template file 'comments'

-- ChristyFernando - 18 Dec 2012

yes indeed. Do you have a file on your system templates/comments.tmpl And is it readable by the server? That file was shipped in both the upgrade and the full versions of Foswiki 1.1.6, and certainly should be in older releases as well.

-- GeorgeClark - 18 Dec 2012

Ya the file is in templates. When I installed foswiki I did chown -R apache:apache foswiki. I am wondering if I should follow the script outlined here: http://foswiki.org/Support/SettingFileAccessRightsLinuxUnix ?

-- ChristyFernando - 19 Dec 2012



Ran the script and it didn't change anything. Still get the template could not be read error.

-- ChristyFernando - 19 Dec 2012

New thing I found today in the error logs. I have no clue what this is lol:

2012-12-18T15:39:46Z warning CommengPlugin could not be loaded. No $Foswiki::cfg{Plugins}{CommengPlugin}{Module} defined - re-run configure ---


What the heck is CommengPlugin?

-- ChristyFernando - 19 Dec 2012


This appears to be caused by an upgrade failure. The issues were resolved by reinstalling from the tgz file instead of using the rpm packages.

-- GeorgeClark - 21 Dec 2012

Hi George, my Foswiki is 1.1.9 on CentOS 6.6, and I installed Foswiki by yum. I have the "Could not read template file 'comments'" error, but no "CommengPlugin could not be loaded" error. Even after I 'tar xzvf CommentPlugin.tgz', it still not working. What should I do now? Please help.

-- Jim168Chang - 23 Mar 2015

Jim168Chang, Unfortunately the developer who supports the RPM and .deb packages, is no longer active in the project. I don't use either of those platforms, so I have no idea really what is going on. Can you verify that templates/comment.tmpl file exists, and is readable by the web server user?

-- GeorgeClark - 23 Mar 2015

[root@wiki /]$ [root@wiki /]$ls -al /var/lib/foswiki/templates/comments.tmpl -r--r--r-- 1 apache apache 160 Dec 2 2012 /var/lib/foswiki/templates/comments.tmpl [root@wiki /]$

-- Jim168Chang - 24 Mar 2015

I also re-install it twice on foswiki/bin/configure?action=FindMoreExtensions, that's the message I got:

uselocal disabled, download required Unpacking /tmp/QCrBKMSQl9.tgz..., Size: 19683 Modified: Tue Mar 24 08:24:30 2015 for package archive Saving /tmp/QCrBKMSQl9.tgz to /var/lib/foswiki/working/configure/download/CommentPlugin.tgz Installed: data/Sandbox/CommentPluginExampleComments.txt as /var/lib/foswiki/data/Sandbox/CommentPluginExampleComments.txt Installed: data/Sandbox/CommentPluginExamples.txt as /var/lib/foswiki/data/Sandbox/CommentPluginExamples.txt Installed: data/Sandbox/CommentPluginTemplateExample.txt as /var/lib/foswiki/data/Sandbox/CommentPluginTemplateExample.txt Installed: data/System/CommentPlugin.txt as /var/lib/foswiki/data/System/CommentPlugin.txt Installed: data/System/CommentPluginTemplate.txt as /var/lib/foswiki/data/System/CommentPluginTemplate.txt Installed: data/System/VarCOMMENT.txt as /var/lib/foswiki/data/System/VarCOMMENT.txt Installed: lib/Foswiki/Plugins/CommentPlugin.pm as /var/lib/foswiki/lib/Foswiki/Plugins/CommentPlugin.pm Installed: lib/Foswiki/Plugins/CommentPlugin/Comment.pm as /var/lib/foswiki/lib/Foswiki/Plugins/CommentPlugin/Comment.pm Installed: pub/System/CommentPlugin/wikiringlogo20x20.png as /var/lib/foswiki/pub/System/CommentPlugin/wikiringlogo20x20.png Installed: templates/comments.tmpl as /var/lib/foswiki/templates/comments.tmpl Installed: CommentPlugin_installer to /var/lib/foswiki/working/configure/pkgdata

And I also enable this plugin: {Plugins}{CommentPlugin}{Enabled}

Moreover, I restarted httpd, but I still got "Could not read template file 'comments'" error when I browse foswiki/Sandbox/CommentPluginExamples

Any other settings should I check?

-- Jim168Chang - 24 Mar 2015

BTW, thanks George, I didn't expect you would answer my question because the last question for this issue is 2+ years ago!

-- Jim168Chang - 24 Mar 2015

I just found that I got this error message on the page foswiki/Sandbox/CommentPluginExamples:

No such template def TMPL:DEF{PROMPT:example}

Hope it help debug.

-- Jim168Chang - 24 Mar 2015

I just found that I don't have "UserCommentsTemplate" topic in my installation, is it a 'must have' file?

-- Jim168Chang - 24 Mar 2015

I tried to add a line in the Comment.pm file: $templateFile = 'view';

before the line: my $templates = Foswiki::Func::loadTemplate($templateFile);

And then there is NO "Could not read template file 'view'" error!

Then, I copied comments.tmpl to mycomments.tmpl, and modify the line: $templateFile = 'view';

to be: $templateFile = 'mycomments';

then the error "Could not read template file 'mycomments'" comes.

view.tmpl, comments.tmpl and mycomments.tmpl are all in the same directory, why view.tmpl can be read but comments.tmpl and mycomments.tmpl cannot be read?

-- Jim168Chang - 24 Mar 2015

[root@wiki templates]# more comments.tmpl

%{ This will pick up templates from the System or, if the topic is defined, from the web containing the COMMENT }%

%TMPL:INCLUDE{CommentPlugin}%

%{ end }%

[root@wiki templates]#

But I cannot see any 'CommentPlugin.tmpl' file in the templates diretory, is that why "Could not read template file 'comments'" error?

-- Jim168Chang - 24 Mar 2015

Compare the file permissions for the files. ls -la templates/view ls -la templates/comments.tmpl Is there any difference in the flags, user or group?

Does centos have mandatory access controls enabled? You might need to disable or somehow reconfigure SELinux access controls.

-- GeorgeClark - 24 Mar 2015

Re "But I cannot see any 'CommentPlugin.tmpl' file ..." In this case it's using the Templates search path to search for a topic named 'CommentPluginTemplate' which does (or should) exist in your System web. Because of the search path, it will take the first one it finds, either in the web with the %COMMENT macro, or from System. That's all correct. By any chance have you made your System web view restricted? Make sure the user can read the CommentPluginTemplate topic.

-- GeorgeClark - 24 Mar 2015

File permissions are the same: [root@wiki templates]# ls -la view.tmpl comments.tmpl -r--r--r-- 1 apache apache 160 Dec 2 2012 comments.tmpl -r--r--r-- 1 apache apache 1346 Mar 6 2014 view.tmpl [root@wiki templates]#

My VM was bought on DigitalOcean, and SELinux is disabled by default, but I don't know if CentOS has other mandatory access controls enabled, can you help let me know how?

Yes, user can read the CommentPluginTemplate topic, but I still get "Could not read template file 'comments'" error.

Can you help suggest a value in %TMPL:INCLUDE{CommentPlugin}% to test? Or, can I just copy all the CommentPluginTemplate.txt content to replace all the content of the comments.tmpl file?

-- Jim168Chang - 25 Mar 2015

I just replaced the whole content of comments.tmpl by the content of CommentPluginTemplate.txt, and then it works!

So, does it means the problem comes from the Templates search path?

-- Jim168Chang - 25 Mar 2015

Maybe. Could you paste in your

$Foswiki::cfg{TemplatePath} = "...' line from your LocalSite.cfg?

-- GeorgeClark - 25 Mar 2015

This is what a normal template path looks like in the config.
$Foswiki::cfg{TemplatePath} = '$Foswiki::cfg{TemplateDir}/$web/$name.$skin.tmpl, $Foswiki::cfg{TemplateDir}/$name.$skin.tmpl, $web.$skinSkin$nameTemplate, $Foswiki::cfg{SystemWebName}.$skinSkin$nameTemplate, $Foswiki::cfg{TemplateDir}/$web/$name.tmpl, $Foswiki::cfg{TemplateDir}/$name.tmpl, $web.$nameTemplate, $Foswiki::cfg{SystemWebName}.$nameTemplate';

-- GeorgeClark - 25 Mar 2015

$Foswiki::cfg{TemplatePath} = '/var/lib/foswiki/templates/$web/$name.$skin.tmpl, /var/lib/foswiki/templates/$name.$skin.tmpl, /var/lib/foswiki/templates/$web/$name.tmpl, /var/lib/foswiki/templates/$name.tmpl, $web.$skinSkin$nameTemplate, Foswiki.$skinSkin$nameTemplate, $web.$nameTemplate, Foswiki.$nameTemplate';

$Foswiki::cfg{TemplateDir} = '/var/lib/foswiki/templates';

$Foswiki::cfg{SystemWebName} = 'System';

-- Jim168Chang - 26 Mar 2015

That's it!

The normal template path you mentioned is the same as the one when I choose "use default" in bin/configure. And, after saving the new configuration and restoring the comments.tmpl back to the original one, there is no more "Could not read template file 'comment'" error!

Thank you very much! George.

-- Jim168Chang - 26 Mar 2015
 

QuestionForm edit

Subject Using an extension
Extension CommentPlugin
Version Foswiki 1.1.6
Status Answered
Related Topics
Topic revision: r25 - 26 Mar 2015, Jim168Chang
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy