Support standard chromium_path and improve Docker compatibility#526
Open
1060778506 wants to merge 1 commit into
Open
Support standard chromium_path and improve Docker compatibility#5261060778506 wants to merge 1 commit into
1060778506 wants to merge 1 commit into
Conversation
The Problem:
Currently, Print Designer only looks for the chromium_binary_path key in the site configuration. In many Dockerized environment (like frappe_docker), the standard Frappe configuration key is chromium_path. When chromium_binary_path is missing, the app falls back to searching the bench/chromium directory, which is usually empty in containerized setups, leading to a "Chromium not downloaded" error.
The Solution:
Update the _initialize_chromium method in FrappePDFGenerator to support both configuration keys. This aligns the app with Frappe Core standards and ensures out-of-the-box compatibility with Docker.
Proposed Code Change:
Python
# In print_designer/pdf_generator/generator.py
self.CHROMIUM_BINARY_PATH = (
site_config.get("chromium_binary_path")
or site_config.get("chromium_path") # Added for Frappe standard compatibility
or ""
)
Why this matters:
This small change prevents users from having to manually set redundant configuration keys and allows the app to correctly resolve the Chromium binary path provided by the system environment.
|
Duplicate to #523 ? |
Contributor
|
Duplicate of merged PR #523 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Problem:
Currently, Print Designer only looks for the chromium_binary_path key in the site configuration. In many Dockerized environment (like frappe_docker), the standard Frappe configuration key is chromium_path. When chromium_binary_path is missing, the app falls back to searching the bench/chromium directory, which is usually empty in containerized setups, leading to a "Chromium not downloaded" error.
The Solution:
Update the _initialize_chromium method in FrappePDFGenerator to support both configuration keys. This aligns the app with Frappe Core standards and ensures out-of-the-box compatibility with Docker.
Proposed Code Change:
Python
In print_designer/pdf_generator/generator.py
self.CHROMIUM_BINARY_PATH = (
site_config.get("chromium_binary_path")
or site_config.get("chromium_path") # Added for Frappe standard compatibility
or ""
)
Why this matters:
This small change prevents users from having to manually set redundant configuration keys and allows the app to correctly resolve the Chromium binary path provided by the system environment.