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

User mention not rendered in post preview when editing a message and when the user is not cached in the store #3725

Closed
n-peugnet opened this issue Jan 31, 2023 · 1 comment · Fixed by #3769
Assignees
Labels
Milestone

Comments

@n-peugnet
Copy link
Contributor

n-peugnet commented Jan 31, 2023

Current Behavior

When editing a message that contains a user mention, and when the user is not cached in the store, the mention is not rendered in post preview.

Steps to Reproduce

  1. refresh the page to make sure the store is cleared
  2. edit a message that contains a mention to a user
  3. see in the preview that the mention is not rendered

Then:

  1. click the user name in the mention, see that the pop up box opens and shows the name of this user
  2. modify any part of the post
  3. see that the preview is now updated with the correctly rendered user mention

Expected Behavior

The user mention should always look in the preview the way they will be seen once posted.

Screenshots

Peek 2023-01-31 13-53

Environment

  • Flarum version: 1.6.2
  • Website URL: localhost
  • Webserver: PHP built-in web server
  • Hosting environment: local
  • PHP version: 8.2.1 (cli) (built: Jan 6 2023 15:12:40) (NTS)
  • Browser: Mozilla Firefox 109.0

Output of php flarum info

Flarum core 1.6.2
PHP version: 8.2.1
MySQL version: 10.6.11-MariaDB-2
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, intl, exif, mysqli, pdo_mysql, pdo_sqlite, Phar, posix, readline, shmop, SimpleXML, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, Zend OPcache, xdebug
+----------------------+---------+--------+
| Flarum Extensions    |         |        |
+----------------------+---------+--------+
| ID                   | Version | Commit |
+----------------------+---------+--------+
| flarum-flags         | v1.6.1  |        |
| flarum-approval      | v1.6.1  |        |
| flarum-tags          | v1.6.1  |        |
| flarum-suspend       | v1.6.1  |        |
| flarum-subscriptions | v1.6.1  |        |
| flarum-sticky        | v1.6.1  |        |
| flarum-statistics    | v1.6.1  |        |
| flarum-mentions      | v1.6.1  |        |
| flarum-markdown      | v1.6.1  |        |
| flarum-lock          | v1.6.1  |        |
| flarum-likes         | v1.6.1  |        |
| flarum-lang-french   | v4.4.0  |        |
| flarum-lang-english  | v1.6.0  |        |
| flarum-emoji         | v1.6.1  |        |
| flarum-bbcode        | v1.6.0  |        |
+----------------------+---------+--------+
Base URL: http://localhost:8080
Installation path: /home/nicolas/Source/www/flarum
Queue driver: sync
Session driver: file
Mail driver: smtp
Debug mode: ON

Possible Solution

This could make use of an API that allows to refresh the composer preview as described in #3720.

I solved this problem in my extension by making a store call in the TextFormatter filter's JS part, then refreshing the preview once the promise resolved: https://github.com/club-1/flarum-ext-cross-references/pull/7/files#diff-0fa1a002dc778d61dfd77c836df026dc259755459ef9417ad12450569c211388

Thus, it looks very strange in the preview when the mention is not rendered correcly:
Peek 2023-01-31 14-12

Additional Context

No response

@SychO9
Copy link
Member

SychO9 commented Apr 15, 2023

This is a formatting issue which is solved in #3769

@SychO9 SychO9 added this to the 1.8 milestone Apr 15, 2023
@SychO9 SychO9 self-assigned this Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants