fenepedia / contao-er24-rechtstexte

Contao Erweiterung für die Integration von Rechtstexten über die eRecht24 API
GNU General Public License v3.0
2 stars 2 forks source link

Wrong evaluated email insert tag inside "Name und Anschrift der zuständigen Kammer" textarea #14

Closed M-Zoldak closed 1 year ago

M-Zoldak commented 1 year ago

I've found weird bug with automatically parsing e-mails.

The bug appeared inside "Aufsichts­behörde, Berufs­bezeichnung" in the "Name und Anschrift der zuständigen Kammer" textarea after entering an email.

End of insert tags are placed exactly inside following br tag <b|here|r /> , causing email not to be parsed into html tag.

image

Coming from Back-End:

image

As i checked value on textarea at erecht24, the line with e-mail seems to be written correctly - E-Mail: email@example.com\n

fenepedia commented 1 year ago

@fritzmg @etlam Can you someone check this?

fritzmg commented 1 year ago

What is the original HTML code?

fritzmg commented 1 year ago

I have updated the email regex in https://github.com/fenepedia/contao-er24-rechtstexte/commit/2fbd67e9a5a65b7a1e5bd885797cd879f6ce5133 - please try dev-main.

etlam commented 1 year ago

I can not help with the original html code, as i am not able to find the project this snippet belongs to.

M-Zoldak commented 1 year ago

New implementation works a bit better, but issue still persists. Here you can view current regex output: https://regex101.com/r/JrY09P/1

image

Client website: https://www.ratajak-steuerberatung.de/impressum

etlam commented 1 year ago
<h2>Berufsbezeichnung und berufsrechtliche Regelungen</h2>
<p>Berufsbezeichnung:<br />
Steuerberater</p>
<p>Zust&auml;ndige Kammer:<br />
Steuerberaterkammer M&uuml;nchen<br />
K&ouml;rperschaft des &ouml;ffentlichen Rechts<br />
Nederlinger Str. 9<br />
80638 M&uuml;nchen<br />
Deutschland<br />
Telefon: +49(0)89 / 15 79 02-0<br />
Fax: +49(0)89 / 15 79 02-19<br />
E-Mail: info@stbk-muc.de<br />
www.stbk-muc.de</p>
fritzmg commented 1 year ago

Try again with the current dev-main. However, there will still be edge cases. e.g. <br>foobar@example.com won't work.

M-Zoldak commented 1 year ago

I've currently another problem. I'm not sure if the Regex causing it, or there is an issue with eRecht itself. I've entered totally another mail inside, and tried to sync legal texts. eRecht said, that my exports were successful, but new imprint wasn't imported.

I've already tried clearing the cache, and even creating new eRecht key, and connecting it with website(came new secret and client Id), but there is no change in DB/Frontend. I also haven't found anything in logs.

etlam commented 1 year ago

I've currently another problem. I'm not sure if the Regex causing it, or there is an issue with eRecht itself. I've entered totally another mail inside, and tried to sync legal texts. eRecht said, that my exports were successful, but new imprint wasn't imported.

I've already tried clearing the cache, and even creating new eRecht key, and connecting it with website(came new secret and client Id), but there is no change in DB/Frontend. I also haven't found anything in logs.

Same website as above? Then I will have a look at the logs for Rechtstexte API.

M-Zoldak commented 1 year ago

Yes, it's the same one.

etlam commented 1 year ago

The Contao receives the push from eRecht24 Rechtstexte API and answers with http status 200 and message "OK".

Now the Contao should flush the corresponding cache tag for the legal notice and start a request to the API as soon as the page gets displayed.
But I can not see a request belonging to the website to fetch the new legal notice.

Maybe @fritzmg can help, seems to me like a cache problem with Contao.

fritzmg commented 1 year ago

The request is made here:

https://github.com/fenepedia/contao-er24-rechtstexte/blob/48952a06ba5ad72faf003f29b929192ac47b5ffd/src/Controller/ContentElement/LegalTextElementController.php#L118

@Matheoz-sys does it work if you clear the eRecht24 cache via Contao's system maintenance?

M-Zoldak commented 1 year ago

Just as before, there was no change after clearing cache, but at least I have became this warning in debug mode

image

fritzmg commented 1 year ago

@Matheoz-sys I think https://github.com/fenepedia/contao-er24-rechtstexte/commit/8203806654725692c1f4180188daf5168917d980 should fix that. Please update dev-main again.

M-Zoldak commented 1 year ago

Yes, the new imprint was imported correctly. Thanks for help. 👍