Hello, again!
I have a bit of a problem. I used to have the ajax comment editing add-on on my previous EE2 installation, and it’s now outdated and doesn’t work with EE3. So, I’m going through the instructions here: https://docs.expressionengine.com/latest/comment/index.html#allowing-members-to-edit-comments-on-the-front-end
This is on my WAMP site, but I don’t think it’s related to that. [Also, I do have the comments part on another template that is embedded –I thought I’d mention that “just in case”. Every other part is working, though just the front-end editing is giving me problems.]
I have the code entered on my site pretty much “as is” from the example in the documentation:
{if editable}
<a href="#" class="edit_link">[ Edit ] </a>
<div class="editCommentBox" >
<textarea cols="70" rows="8">{comment_stripped}</textarea><br >
<input type="submit" name="cancel" value="Cancel" class="cancel_edit">
<input type="submit" name="save" value="Save" class="submit_edit">
</div>
{/if}
From the “The JavaScript Code” right under the example in the documentation, I put these two in the <head> of the main page –which is where I’m assuming they go, right?
{exp:jquery:script_tag}
{exp:comment:edit_comment_script}
…and there is the problem. I get:
Exception Caught
No such property: ‘logger’ on EllisLab\ExpressionEngine\Legacy\Façade
[removed]\system\ee\EllisLab\ExpressionEngine\Legacy\Facade.php:107
I removed one at a time just to see what was causing the problem, and when I only have the “exp:comment:edit_comment_script” in the header, there aren’t any errors, but the edit, of course, does nothing.
The “exp:jquery:script_tag” causes the error.
Just to add some additional information, I’ve attached a screenshot of my add-on manger’s jquery entry. It has an “update to 1.0.0” that I absolutely cannot get rid of. It even says that it is version 1.0 on the left, but yet, that “update” thing just doesn’t go away. I’ve uninstalled it and re-installed it, and yet… there is still an update message! So, I don’t know if this is useless info or what, but I thought I’d mention it!
Thank you for your help!!! …and I’m almost finished with the questions, ha ha!
-John Christian
To give a little more info:
Line 107 of ..\system\ee\EllisLab\ExpressionEngine\Legacy\Facade.php doesn’t tell me much:
throw new InvalidArgumentException("No such property: '{$name}' on ".get_called_class());
I must say I’m a little intrigued that in the first part of the error message in my first post on this thread. It says “EllisLab\ExpressionEngine\Legacy\Façade”, and “Façade” with the fancy “C” –I didn’t add that. Probably nothing, but just pointing it out! 😊
If it helps, here is the stack trace:
#0 [removed]\system\ee\EllisLab\ExpressionEngine\Legacy\Facade.php(22): EllisLab\ExpressionEngine\Legacy\Facade->get('logger')
#1 [removed]\system\ee\EllisLab\Addons\jquery\mod.jquery.php(34): EllisLab\ExpressionEngine\Legacy\Facade->__get('logger')
#2 [removed]\system\ee\legacy\libraries\Template.php(1517): Jquery->__construct()
#3 [removed]\system\ee\legacy\libraries\Template.php(1241): EE_Template->process_tags()
#4 [removed]\system\ee\legacy\libraries\Template.php(515): EE_Template->tags()
#5 [removed]\system\ee\legacy\libraries\Template.php(219): EE_Template->parse('{!-- ra:0000000...', false, '1', false)
#6 [removed]\system\ee\legacy\libraries\Template.php(159): EE_Template->fetch_and_parse('', '', false)
#7 [removed]\system\ee\legacy\libraries\Core.php(679): EE_Template->run_template_engine('', '')
#8 [removed]\system\ee\legacy\controllers\ee.php(68): EE_Core->generate_page()
#9 [internal function]: EE->index('this_is_the_tit...')
#10 [removed]\system\ee\EllisLab\ExpressionEngine\Core\Core.php(192): call_user_func_array(Array, Array)
#11 [removed]\system\ee\EllisLab\ExpressionEngine\Core\Core.php(94): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#12 [removed]\system\ee\EllisLab\ExpressionEngine\Boot\boot.php(138): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#13 [removed]\index.php(175): require_once('C:\\Users\\John\\D...')
#13 [removed]\index.php(175): require_once('C:\\Users\\John\\D...')
Also, I did move {exp:jquery:script_tag} and {exp:comment:edit_comment_script} to right before the closing body tag, and it didn’t make a difference (which everyone else probably already knew –I’m still very new to jquery!).
Ok, thank you for your time! Happy Easter!
-John
Happy Easter to you too!
The problem is with the jquery tag- we deprecated it in 3.2.0 and recommend not using it- though it should still work if you install it.
That said- I just tried it going straight from the docs but using a link to google instead of the jquery tag- and everything worked perfectly for me on MAMP.
So- try:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
{exp:comment:edit_comment_script}
Instead of using the jquery tag. That do the trick?
And I’ll be certain to get those docs fixed up as well!
Hey, Robin –thank you! It no longer crashes my page!
I haven’t gotten to the point where I can actually test the front-end comment editing, and actually it might a little bit above my level based on the documentation. [When I read that part, I feel like 10 steps are missing. 😊 ] So, I’ll have to play with it –but I’m sure once I figure out how to do everything correctly, it will function now!
Thank you!
-John Christian
;) Glad it’s no longer blowing up!
And honestly- the editable comments are pretty cut and paste unless you want to customize the js. Which I don’t because I am not particularly good with js.
Here’s the template I tested with:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
{exp:comment:edit_comment_script}
{exp:channel:entries limit="5" channel="news"}
<a href="{permalink="{segment_1}/{segment_2}"}">{title} - {entry_id}</a><br>
{/exp:channel:entries}
<hr>
{exp:comment:form channel="news" preview="channel/preview"}
{if logged_out}
<label for="name">Name:</label> <input type="text" name="name" value="{name}" size="50" ><br >
<label for="email">Email:</label> <input type="text" name="email" value="{email}" size="50" ><br >
<label for="location">Location:</label> <input type="text" name="location" value="{location}" size="50" ><br >
<label for="url">URL:</label> <input type="text" name="url" value="{url}" size="50" ><br >
{/if}
<label for="comment">Comment:</label><br >
<textarea name="comment" cols="70" rows="10">{comment}</textarea>
<label><input type="checkbox" name="save_info" value="yes" {save_info} > Remember my personal information</label><br >
<label><input type="checkbox" name="notify_me" value="yes" {notify_me} > Notify me of follow-up comments?</label><br >
{if captcha}
<label for="captcha">Please enter the word you see in the image below:</label><br >
<p>{captcha}<br >
<input type="text" name="captcha" value="{captcha_word}" maxlength="20" ></p>
{/if}
<input type="submit" name="submit" value="Submit" >
<input type="submit" name="preview" value="Preview" >
{/exp:comment:form}
<hr>
<h3>Comments</h3>
{exp:comment:entries limit="20"}
<div class="comment" id="comment_{comment_id}">
<span class="comment_body">
{comment}
</span>
{if editable}
<a href="#" class="edit_link">Edit</a>
<div class="editCommentBox" style="display:none;">
<textarea cols="70" rows="8">{comment_stripped}</textarea><br >
<input type="submit" name="cancel" value="Cancel" class="cancel_edit">
<input type="submit" name="save" value="Save" class="submit_edit">
</div>
{/if}
{if can_moderate_comment}
<a href="#" class="mod_link">Close</a>
{/if}
</div>
{/exp:comment:entries}
Just put it on an empty template, make sure channel=”news” in the two tags actually points to a channel shortname that exists, then view the template. It should show you some channel titles- click on one, and you should get a comment form.
If you don’t- it’s likely a permission issue- meaning you’re viewing the page as a user without permission to post comments.
If you do see the form- just add a comment and it should show up- and be editable.
It’s not a pretty template, but it is definitely easy to follow ;)
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.