Issue with installing child styles when parent style name is modified in ACP

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Post Reply
User avatar
cabot
Registered User
Posts: 12
Joined: Sun Jun 02, 2013 11:15 am

Issue with installing child styles when parent style name is modified in ACP

Post by cabot »

Hello,

Currently, if the name of a style is changed in the ACP, it is not possible to install the child styles that depend on it. This is particularly problematic for prosilver, the default, non-removable style, which is the parent/ancestor of the majority of inherited styles.

Problem Description:
For style installation requirements, phpBB checks the name of the parent style based on the value of the parent key in the style.cfg file. This check depends on the style_name field stored in the database. If this name is modified from the PCA (which is possible for all styles, including prosilver), this causes an inconsistency and prevents the installation of child styles, as phpBB considers that the required parent style is not installed.

Suggested solutions:
  1. Disable style name modification from the PCA.
    • Prevent the modification of style names via the APC, or at least for prosilver on which so many styles depend.
  2. Add a ‘decorative/passive’ style_custom_name field.
    • This field would return the default style name if unmodified, otherwise the one defined by the administrator in the PCA.
  3. Ignore strict name checking.
    • Adapt the style installation logic so that it is based solely on the style_path of the parent style instead of its style_name in the database. (But requires a style_path key to be added to the styles .cfg)


[Off topic] There's a bug with custom BBCodes on this board ^^
  • Click on C returns [gist=]
  • Click on gist= returns [strike][/strike]
  • Click on strike returns nothing

warmweer
Registered User
Posts: 121
Joined: Wed Jul 09, 2003 5:27 pm
Location: Belgium

Re: Issue with installing child styles when parent style name is modified in ACP

Post by warmweer »

cabot wrote: Mon Oct 28, 2024 11:36 am [Off topic] There's a bug with custom BBCodes on this board ^^
  • Click on C returns [gist=]
  • Click on gist= returns [strike][/strike]
  • Click on strike returns nothing
confirmed the bug mentioned
Procrastination is my hobby, but I keep on postponing it.

User avatar
rxu
Registered User
Posts: 168
Joined: Tue Apr 04, 2006 4:28 pm
Contact:

Re: Issue with installing child styles when parent style name is modified in ACP

Post by rxu »

warmweer wrote: Mon Oct 28, 2024 4:26 pm confirmed the bug mentioned
Probably related JS error in console:

Code: Select all

Uncaught TypeError: Cannot read properties of undefined (reading 'length')
    at bbfontstyle (editor.js?assets_version=2519:89:35)
    at bbstyle (editor.js?assets_version=2519:52:3)
    at HTMLButtonElement.onclick (posting.php?mode=reply&t=86866:450:136)

starc01
Registered User
Posts: 1
Joined: Thu Nov 21, 2024 1:38 pm

Re: Issue with installing child styles when parent style name is modified in ACP

Post by starc01 »

cabot wrote: Mon Oct 28, 2024 11:36 am Hello,

Currently, if the name of a style is changed in the ACP, it is not possible to install the child styles that depend on it. This is particularly problematic for prosilver, the default, non-removable style, which is the parent/ancestor of the majority of inherited styles.

Problem Description:
For style installation requirements, phpBB checks the name of the parent style based on the value of the parent key in the style.cfg file. This check depends on the style_name field stored in the database. If this name is modified from the PCA (which is possible for all styles, including prosilver), this causes an inconsistency and prevents the installation of child styles, as phpBB considers that the required parent style is not installed.

Suggested solutions:
  1. Disable style name modification from the PCA.
    • Prevent the modification of style names via the APC, or at least for prosilver on which so many styles depend.
  2. Add a ‘decorative/passive’ style_custom_name field.
    • This field would return the default style name if unmodified, otherwise the one defined by the administrator in the PCA.
  3. Ignore strict name checking.
    • Adapt the style installation logic so that it is based solely on the style_path of the parent style instead of its style_name in the database. (But requires a style_path key to be added to the styles .cfg)
[Off topic] There's a bug with custom BBCodes on this board ^^
  • Click on C returns [gist=]
  • Click on gist= returns [strike][/strike]
  • Click on strike returns nothing
The issue with modifying style names in the ACP causing child style installation errors is significant, especially for prosilver. A practical solution is to disable renaming critical styles like prosilver or base installation on style_path instead of style_name. This ensures consistency and avoids breaking dependencies.

Post Reply