File tree 3 files changed +10
-3
lines changed
3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ public function entryFieldName(): string
24
24
return $ this ->entryField ?? 'entry ' ;
25
25
}
26
26
27
+ public function tooltipFieldName (): string
28
+ {
29
+ return $ this ->tooltipField ?? 'tooltip ' ;
30
+ }
31
+
27
32
/**
28
33
* Get the entry where mentions are parsed to html links
29
34
*/
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public function saving(Model $model)
40
40
public function saved (Model $ model )
41
41
{
42
42
// @phpstan-ignore-next-line
43
- if (! $ model ->isDirty ($ model ->entryFieldName ())) {
43
+ if (! $ model ->isDirty ($ model ->entryFieldName ()) && ! $ model -> isDirty ( $ model -> tooltipFieldName ()) ) {
44
44
return ;
45
45
}
46
46
if (method_exists ($ model , 'mentions ' )) {
Original file line number Diff line number Diff line change @@ -197,8 +197,10 @@ protected function entry(): self
197
197
}
198
198
199
199
// @phpstan-ignore-next-line
200
- $ mentions = $ this ->extract ($ this ->model ->{$ this ->model ->entryFieldName ()});
201
-
200
+ $ entryMentions = $ this ->extract ($ this ->model ->{$ this ->model ->entryFieldName ()});
201
+ // @phpstan-ignore-next-line
202
+ $ tooltipMentions = $ this ->extract ($ this ->model ->{$ this ->model ->tooltipFieldName ()});
203
+ $ mentions = array_merge ($ tooltipMentions , $ entryMentions );
202
204
foreach ($ mentions as $ data ) {
203
205
$ type = $ data ['type ' ];
204
206
$ id = $ data ['id ' ];
You can’t perform that action at this time.
0 commit comments