Problem/Motivation

When we install the "smart linker AI" plugin in the CKEditor and use that plugin with any content, then generating a result and clicking "Save changes to editor," the originally selected text disappears instead of being replaced with the modified content. This disrupts user expectations and results in data loss within the editor.

Steps to reproduce

1. Enable the SmartLinker AI Module plugin in CKEditor
2. Choose the AI provider and save the configuration
3. Open a CKEditor field in the content
4. Select any portion of text.
5. Click the "Generate Internal Links" plugin under AI Assistant.
6. In the modal, add a keyword or a number of links
7. Click on the generate button
8. Once the result is displayed in the "Result" field, click "Save changes to editor".
9. Observe that the original selected text disappears, and no replacement is inserted.

Please check the Video link for reference:
Link : https://www.loom.com/share/a3971de7e05a40ccbe8400ba417eb89c

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#4 beforefix.gif1.3 MBanjaliprasannan
#4 afterfix.gif473.94 KBanjaliprasannan
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ishani patel created an issue. See original summary.

ishani patel’s picture

Assigned: ishani patel » Unassigned
Status: Active » Needs review

Hello,
I've created MR,
Kindly review.

Thank you!

anjaliprasannan’s picture

StatusFileSize
new473.94 KB
new1.3 MB

Reviewed the fix and it works fine. Keeping in Needs review for code review. Attaching before and after screencast

anjaliprasannan’s picture

Status: Needs review » Reviewed & tested by the community

I have checked the code and LGTM

zeeshan_khan’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for fixing the bug!
@ishani patel

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.