HugoFara / lwt

Learn languages by reading! A language learning app stemmed from Learning with Texts (LWT).
https://hugofara.github.io/lwt/
The Unlicense
168 stars 19 forks source link

Error in Step 2 of the 'New Feed Wizard' #129

Closed 6onz4 closed 5 months ago

6onz4 commented 1 year ago

Describe the bug I can't add a new feed with 'New Feed Wizard'. I encountered a Fatal error in 'Step 2 - Select Article Text' after selecting text, clicking on 'Get' and then clicking on 'Next'.

Error message

Warning: Undefined array key "host" in C:\xampp\htdocs\lwt\feed_wizard.php on line 439

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in C:\xampp\htdocs\lwt\feed_wizard.php:439 Stack trace: #0 C:\xampp\htdocs\lwt\feed_wizard.php(439): count(NULL) #1 C:\xampp\htdocs\lwt\feed_wizard.php(930): Lwt\Interface\Feed_Wizard\feed_wizard_filter_text() #2 {main} thrown in C:\xampp\htdocs\lwt\feed_wizard.php on line 439

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Newsfeeds '
  2. Click on 'New Feed'
  3. Click on 'New Feed Wizard'
  4. Add a Feed URI in the field. I tried with https://rss.dw.com/xml/rss_en_science and others
  5. Click on 'Next'
  6. Scroll down in the preview window
  7. Click on a paragraph of the article
  8. Click on 'Get'
  9. Click on 'Next'
  10. See error

Expected behavior Advance to next step of the 'New Feed Wizard' and then get the RSS feed added to my Feeds.

Screenshots 1_screenshot 2_screenshot

Server Data Value LWT version v002008001 Database name learning-with-texts Database prefix (surrounded by "") "" Database Location Apache/2.4.56 Database Size 0.2 MB Web Server localhost Server Software Apache/2.4.56 PHP Version 8.2.4 MySQL Version 10.4.28-MariaDB

Desktop

Additional context

HugoFara commented 1 year ago

Hi! Thank you for your detailed system report! I have tried applying the same procedure and ran into the same issue. I think the kind of feeds you want to use are to complex to work with LWT. I have tried some advanced feed import settings without more success than you.

The feed wizard feature was not developed by me, does not work so well and it is too complex to maintain. It's better to avoid using it for now.

6onz4 commented 1 year ago

Hi, thank you for your quick response. I thought maybe I was doing something wrong. I will try it with simpler feeds or copy and paste the articles manually. By the way, great job with this fork :)

HugoFara commented 8 months ago

I improved the situation a bit I think in 06ae857 as the errors appears in step 3, but is still the same.

I also improved code readability, and fixed some JS issues on the feed wizard 0a36899, but I could not debug the code, as it is too complex to read. I hope it won't be too inconvenient for you...

Thank you for your support, I'm setting this issue as help wanted as I couldn't find a solution. However, I think only a total rewrite of the feature could work here.

Have a great day!

6onz4 commented 8 months ago

I appreciate your efforts to refactor and improve the whole repo and fix this bug. Unfortunately right now I don't have enough knowledge in these programming languages to help you. I hope you get help soon.

Have a nice day!