backdrop-contrib / domain

A domain-based access control system for Backdrop CMS
https://backdropcms.org/project/domain
3 stars 5 forks source link

Warning: Undefined array key "var" with Domain Theme submodule #43

Open stpaultim opened 2 weeks ago

stpaultim commented 2 weeks ago

Warning: Undefined array key "var" in domain_theme_settings_submit() (line 305 of /var/www/html/modules/domain/domain_theme/domain_theme.admin.inc).

Getting this error when trying to assign a theme to a specific domain with the domain_theme sub-module enabled. The modules works, but generates this warning.

stpaultim commented 2 weeks ago

This is another warning that may be related.

Warning: Undefined array key "favicon_upload" in domain_theme_file_upload() (line 404 of /var/www/html/modules/domain/domain_theme/domain_theme.admin.inc).

stpaultim commented 1 week ago

@sudipto68 and I were looking at these errors tonight and determined that they did not come up during some basic use of the module.

To recreate these errors, I had to assign both domains the Basis theme and then use the Color Module to change the header color. This triggered these specific errors.

I'm not sure I could consider these "Warnings" to block a beta release.

Once again, even in these conditions, the module works as expected, other than generating these warnings.

izmeez commented 1 week ago

My testing of the domain_theme submodule yields failures and successes.

Steps: On the default domain enable themes that may be used at /admin/appearance/list. Go to the domain list at /admin/structure/domain/view. Choose a subdomain, click on Edit domain and click on tab menu item Theme. A different theme can be selected and then click Set domain theme. This works and the new theme shows for the chosen subdomain without displaying errors or warnings on php 7.4.x

However, efforts to configure a theme, such as changing the header color in basis, fail using the above process or alternatively:

Go to a subdomain url. Go to appearance and click on settings for theme. A notice warns to use the url for the specific subdomain /admin/structure/domain/view/3/theme/basis/theme-settings. Click on suggested url. Then modify the theme, eg, header color. Note: the submit button says: Save Theme Settings. When user clicks on this, in our case, 3 warnings are displayed:

Notice: Undefined index: logo_upload in domain_theme_file_upload() (line 397 of \modules\domain\domain_theme\domain_theme.admin.inc). Notice: Undefined index: favicon_upload in domain_theme_file_upload() (line 404 of \modules\domain\domain_theme\domain_theme.admin.inc). Notice: Undefined index: var in domain_theme_settings_submit() (line 305 of \modules\domain\domain_theme\domain_theme.admin.inc).

AND the screen shows a list of themes and the submit button at the bottom says: Set domain theme as with previous method above. Whether or not user clicks on that submit button, returning to the site shows the change has not taken effect.

So I am not able to replicate your findings as described.

I have only enabled the domain and domain_theme modules. Maybe, you also have the domain_settings module enabled?

izmeez commented 1 week ago

Possibly, the reason for the differences in my findings are because I had already applied the fix in #39 and the PR #46.