Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded Comments - Inherit dashboard post format type #8767

Merged
merged 1 commit into from May 17, 2019

Conversation

Projects
None yet
3 participants
@cchabilall83
Copy link
Contributor

commented May 2, 2019

Per #8738 we mounted an editor for embedded content and set the format type for those comments to TextEx. The format of TextEx causes a mismatch with that of the form and would cause content to render incorrectly. Quotes rendering was especially off (see below).

This allows for the comment form to inherit the format type set in the dashboard so that there would be no conflict in rendering. So changes had to be made in embed view and the rich editor plugin to ensure the data being accessed was an object instead of an array. This was done to make sure rich content would display correctly on the page where the embedded comments were displayed.

Example of Embedded Comment with a quote

> @user1 said:
> Quoted Text form the body of the comment
> 

This looks weird ^

To test:

Ensure you have embedded comments functioning

  1. Test posting and embedded comment
  2. Test quoting the the posted comment
  3. Repeat steps with all different formats available

Close #8748

@@ -66,6 +66,8 @@ function writeComment($comment, $sender, $session, $currentOffset) {
// Whether to order the name & photo with the latter first.
static $userPhotoFirst = null;
$comment = (is_array($comment)) ? (object)$comment: $comment;

This comment has been minimized.

Copy link
@cchabilall83

cchabilall83 May 3, 2019

Author Contributor

$permalink = val('Url', $comment, '/discussion/comment/'.$comment->CommentID.'/#Comment_'.$comment->CommentID);

@@ -119,10 +119,13 @@ public function base_afterFlag_handler($sender, $args) {
protected function addQuoteButton($sender, $args) {
// There are some case were Discussion is not set as an event argument so we use the sender data instead.
$discussion = $sender->data('Discussion');
$discussion = (is_array($discussion)) ? (object)$discussion : $discussion;

This comment has been minimized.

Copy link
@cchabilall83

cchabilall83 May 3, 2019

Author Contributor

if (!Gdn::session()->checkPermission('Vanilla.Comments.Add', false, 'Category', $discussion->PermissionCategoryID)) {

@charrondev
Copy link
Contributor

left a comment

This was a code review only, but I have seen it on chris's end.

We'll need to backport this to release/2019.006 and release/3.0.

@cchabilall83 cchabilall83 merged commit e586c51 into master May 17, 2019

2 checks passed

Travis CI - Pull Request Build Passed
Details
license/cla Contributor License Agreement is signed.
Details

cchabilall83 added a commit that referenced this pull request May 17, 2019

cchabilall83 added a commit that referenced this pull request May 17, 2019

Merge pull request #8817 from vanilla/back/8767
Backport #8767 [release/2019.006]

@charrondev charrondev deleted the fix/embedded-comments-quoting branch Jun 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.