Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 136
    • Merge requests 136
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !2139

Open
Created Jul 24, 2025 by Xiaowu Zhang@xiaowu.zhangDeveloper
  • Report abuse
Report abuse

Draft: WebSite.py: fix find common part logic

  • Overview 0
  • Commits 2
  • Changes 3

while using erp5 with python3 in renderjs interface, i found that the development mode is broken

screen-capture__1_

the reason is manage_main return something like

<!doctype html>
....
	<link rel="stylesheet" type="text/css" href="/erp5/web_site_module/renderjs_runner/bootstrap-4.6.0/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="/erp5/web_site_module/renderjs_runner/fontawesome-free-5.15.2/css/all.css" />
	<link rel="stylesheet" type="text/css" href="/erp5/web_site_module/renderjs_runner/zmi_base.css" />
	<script src="/erp5/web_site_module/renderjs_runner/jquery-3.5.1.min.js"></script>
	<script src="/erp5/web_site_module/renderjs_runner/bootstrap-4.6.0/bootstrap.bundle.min.js"></script>
	<script src="/erp5/web_site_module/renderjs_runner/ace.ajax.org/ace.js"></script>
	<script src="/erp5/web_site_module/renderjs_runner/zmi_base.js"></script>
	<script src="/erp5/web_site_module/renderjs_runner/zmi.localstorage.api.js"></script>

.....

and request to all those files return 404

image

after some search, it's because in python3, we use Zope 5.11.1

in this version, the logic to process those files are changed , instead of those in 4.8.11

in the new version, it call physicalPathToURL, which call then the our custom _physicalPathToVirtualPath

while checking the codes to find the common part

it seems there has a bug when website_path and path has nothing common

in our case above,

website_path = ('', 'erp5', 'web_site_module', 'renderjs_runner')

path = ('++resource++zmi', 'bootstrap-4.6.0', 'bootstrap.bundle.min.js')

there has no common part, common_index is already 0

but those codes are still running

if path_len > common_index + 1:
  path = website_path + path[common_index + 1:]

finally path = ('', 'erp5', 'web_site_module', 'renderjs_runner', 'bootstrap-4.6.0', 'bootstrap.bundle.min.js')

without ++resource++zmi, thus it can't be found and return 404

@jerome what do you think about the fix ?

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: fix/manage_main_view_on_web
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7