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

Multi-word terms occasionally don't highlight #70

Closed
jzohrab opened this issue Nov 8, 2022 · 1 comment
Closed

Multi-word terms occasionally don't highlight #70

jzohrab opened this issue Nov 8, 2022 · 1 comment
Labels
bug Something isn't working ux User Experience could be better

Comments

@jzohrab
Copy link

jzohrab commented Nov 8, 2022

This is quite odd -- in some places, mwords highlight, and in others, not. This persists after page refresh. For example:

image
...
image

Both of the circled terms are defined in the db:

mysql> select woid, wolgid, wotext, wotextlc, wowordcount from words where wotext like '%importancia%' or wotext like '%con el tiempo%';
+------+--------+-------------------------+-------------------------+-------------+
| woid | wolgid | wotext                  | wotextlc                | wowordcount |
+------+--------+-------------------------+-------------------------+-------------+
| 5023 |      1 | quitándole importancia  | quitándole importancia  |           2 |
| 5030 |      1 | Con el tiempo           | con el tiempo           |           3 |
+------+--------+-------------------------+-------------------------+-------------+
2 rows in set (0.01 sec)

If I click and drag on "quitándole importancia", the term actually shows up in the edit window, so the code can find it.

Not sure what other info to attach to this issue :-)

@HugoFara HugoFara added bug Something isn't working ux User Experience could be better labels Nov 9, 2022
@HugoFara
Copy link
Owner

HugoFara commented Apr 11, 2023

Hi!

I think I stumbled across the cause while working on another issue. Here is what happen:

  1. In 2.2.2, I removed some code SQL by mistake (typo)
  2. Code is unreadable so there was no easy way to figure out the issue.

In a nutshell, I changed those four lines

lwt/inc/database_connect.php

Lines 1261 to 1264 in 8d662cc

$set_wo_sql .= "WHEN (@a$i := @a".($i-1) . ") IS NULL THEN NULL ";
$set_wo_sql_2 .= "WHEN (@a$i := @a".($i-2) .") IS NULL THEN NULL ";
$del_wo_sql .= "WHEN (@a$i := @a0) IS NULL THEN NULL ";
$init_var .= "@a$i=0,";

I removed the string concatenation operator, .=, replacing it by a simple assignment.

As a side not, this is fixed, but this part of the code is largely mysterious and badly coded, so issues may remain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ux User Experience could be better
Projects
None yet
Development

No branches or pull requests

2 participants