Bug 28319

Summary: News under Tools not opening after adding HTML code in MainBlock
Product: Koha Reporter: Sandeep Patel <samrocks1011>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: 20.11   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Code use in news under Mainblock.

Description Sandeep Patel 2021-05-11 13:40:00 UTC
Created attachment 120842 [details]
Code use in news under Mainblock.

Dear Team,

Under Tools Section under news, I added the HTML code after which the news page is continuously refreshing with error in the intranet-error.log file. 

-----Error----
[Tue May 11 15:24:30.028112 2021] [cgi:error] [pid 197008] [client 103.67.188.42:59320] AH01215: [Tue May 11 15:24:30 2021] koha-news.pl: Use of uninitialized value $theme in concatenation (.) or string at /usr/share/koha/lib/C4/Languages.pm line 122.: /usr/share/koha/intranet/cgi-bin/tools/koha-news.pl, referer: http://161.97.161.103:4859/cgi-bin/koha/tools/koha-news.pl
[Tue May 11 15:24:30.029803 2021] [cgi:error] [pid 197008] [client 103.67.188.42:59320] AH01215: [Tue May 11 15:24:30 2021] koha-news.pl: Use of uninitialized value in string eq at /usr/share/koha/intranet/cgi-bin/tools/koha-news.pl line 85.: /usr/share/koha/intranet/cgi-bin/tools/koha-news.pl, referer: http://161.97.161.103:4859/cgi-bin/koha/tools/koha-news.pl
--------------

I have attached the HTML code file name code.html that I added in the New under MailBlock.
Comment 1 Owen Leonard 2021-05-11 15:33:40 UTC
The cause of the endless refreshing isn't in Koha, it's in your code. The line, "document.getElementById("defaultOpen").click();" seems to be to blame.
Comment 2 Sandeep Patel 2021-05-12 08:09:05 UTC
Dear Owen,

Thanks for Quick Response. 

Now I am not able to access the News Part, how can I remove the code?

Can I do it from the database, if yes which table the content will be. 

Regards,
Sandeep Patel
Comment 3 Sandeep Patel 2021-05-12 08:21:53 UTC
Dear Owen,

I found the html code under database table opac_news. After replacing the content the Issue Got resolved. 

Thanks Owen.

Regards,
Sandeep Patel