Rubbish in web pages

The web pages created using https://DomainName/app/web-page/new has rubbish text, which apparently looks like json file, like:

{‘is_transparent_header’: 0, ‘title’: ‘Default Header’,
‘is_menu_full_width’: 0, ‘layout_json’:

Full rubbish content is in the part of source (html) from web-browser:

<div class="main-column col-sm-10">
			
<div class="page-content-wrapper">
	<!-- breadcrumbs -->
	<div class="page-breadcrumbs">
	</div>
	<main class="">
		<div class="page-header-wrapper">
			<div class="page-header">
				{'is_transparent_header': 0, 'title': 'Default Header', 'is_menu_full_width': 0, 'layout_json': [{'fullwidth': True, 'columns': [{'width': '20%', 'rows': []}, {'width': '60%', 'rows': []}, {'width': '20%', 'rows': []}]}], 'enable_top_menu': 0, 'sticky_on_top': 0, 'is_dismissable': 0, 'layout': 'One Column', 'sticky_header': 1, 'call_to_action_button': 1, 'button_text': 'Get Started', 'button_link': '#', 'link_target': '_self', 'sticky_header_background': '#ffffff', 'menu_text_color': '#000000', 'items': [{'class_name': 'ucplnjpp', 'column_index': 1, 'content_type': '', 'dynamic_data': 1, 'is_full_width': 0, 'layout_json': None, 'login_required': 0, 'mobile_app_template': None, 'no_of_records': 0, 'reference_document': None, 'section': 'PS-23-00002', 'section_name': 'Header Menu', 'section_type': 'Menu', 'view_more_redirect_to': None, 'view_type': '', 'menus': [{'menu_label': 'Home', 'redirect_url': '/', 'is_mega_menu': 0, 'no_of_column': 0, 'child_menu': []}, {'menu_label': 'About Us', 'redirect_url': '#', 'is_mega_menu': 0, 'no_of_column': 0, 'child_menu': []}, {'menu_label': 'Contact Us', 'redirect_url': '#', 'is_mega_menu': 0, 'no_of_column': 0, 'child_menu': []}]}, {'class_name': 'zfdmvnnm', 'column_index': 2, 'content_type': '', 'dynamic_data': 1, 'is_full_width': 0, 'layout_json': None, 'login_required': 0, 'mobile_app_template': None, 'no_of_records': 0, 'reference_document': None, 'section': 'PS-23-00003', 'section_name': 'Header Button', 'section_type': 'Static Section', 'view_more_redirect_to': None, 'view_type': ''}, {'class_name': 'dbhpursg', 'column_index': 0, 'content_type': '', 'dynamic_data': 1, 'is_full_width': 0, 'layout_json': None, 'login_required': 0, 'mobile_app_template': None, 'no_of_records': 0, 'reference_document': None, 'section': 'PS-23-00017', 'section_name': 'Header Logo', 'section_type': 'Static Section', 'view_more_redirect_to': None, 'view_type': ''}]}
			</div>

This content is in:

div class=“page-header”: i.e.:

How to find the culprit?

Any tools with which I can debug it, which tell about the function executed or file included and extended, or like that.

Any pointer / hint will be appreciated.

The problem might be some blunder done by some one from mine team, or site might be hacked :frowning:


H.S.Rai

WIll it be something like below:

from frappe.website.doctype.web_page.web_page import WebPage
route = "foo"
web_page = WebPage("Web Page", route)
context = {}
web_page.get_context(context)

If yes, what am I doing wrong, as I get error:

In [5]: web_page.get_context(context)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File <ipython-input-5-50e63c436a70>:1
----> 1 web_page.get_context(context)

File ~/erp_gndec/frappe-bench/apps/frappe/frappe/website/doctype/web_page/web_page.py:43, in WebPage.get_context(self, context)
     42 def get_context(self, context):
---> 43         context.main_section = get_html_content_based_on_type(self, "main_section", self.content_type)
     44         context.source_content_type = self.content_type
     45         context.title = self.title

AttributeError: 'dict' object has no attribute 'main_section'

In [6]:


H.S.Rai

Similar issue is noticed at:

A3Sola ERP - What is A3SOLA ?

The rubbish content is commented, so not visible to visitor, but one can see in page’s source code.