Skip to content

Custom Pico theme selection does not list themes after upgrade to NC26 (and hacky workaround) #237

Open
@StuartJMackintosh

Description

@StuartJMackintosh

Context

  • Nextcloud 26 (upgraded from many previous versions)
  • cms_pico installed_version 1.0.21
  • database: Postgres
  • Nextcloud as docker container running inside virtual machine
  • external nginx reverse proxy
  • mixture of sites with their own domain names, and sites hosted in subfolders on the main domain
  • variety of themes

Background

Pico is listed as an untested app in NC26.

I did share this issue on IRC with @PhrozenByte who was kind enough to chat through, and plans testing of Pico & NC26 at some future point.

This issue may also relate to/duplicate #236 although I don't have enough specifics to confirm this.

The efforts with bringing Pico and themes to Nextcloud is very much appreciated!

Problem

After upgrading to NC26, the custom theme interface doesn't list installed themes, therefore these cannot be made available to users.
Specifically, the 'Reload theme' button on the right has no effect, and the dropdown of themes does not list any custom themes.

Screenshot_2023-04-05_11-04-24

Looking at the code (I am not a coder), the function will read the folder listed above the box and offer these themes to be added to the installed themes. Behind the scenes, this runs basic validation of the themes, and copies them to an internal folder, for users to select.

Hacky workaround

WARNING: this is not recommended and could easily destroy all of your data

To get past my today problem, I identified the internal themes folder, manually copied the appropriate theme folders, then added the list to the config array.

As soon as this is applied, the themes are available in the personal settings dropdown

Internal themes folder

docker:~/var_www_html/apps/cms_pico/appdata_public/themes/SoWN6rCUlu$ ls
axcorapico  clean-blog  default  dimension  freelancer-pico-main  just-pico-master  picobook  piconic  story  story-custom

SQL config

update oc_appconfig set configvalue = '
{
    "story":{"name":"story","type":2,"compat":true},
    "clean-blog":{"name":"clean-blog","type":2,"compat":true},
    "dimension":{"name":"dimension","type":2,"compat":true},
    "just-pico-master":{"name":"just-pico-master","type":2,"compat":true},
    "freelancer-pico-main":{"name":"freelancer-pico-main","type":2,"compat":true},
    "picobook":{"name":"picobook","type":2,"compat":true},
    "piconic":{"name":"piconic","type":2,"compat":true},
    "story-custom":{"name":"story-custom","type":2,"compat":true},
    "axcorapico":{"name":"axcorapico","type":2,"compat":true}
}
' where appid = 'cms_pico' and configkey = 'custom_themes';

Don't forget, never run code pasted from websites, if you have not fully verified it and know exactly what it does

Hypothesis

I speculate that the issue relates to the theme copy function, theme validation or simply source file location.
However having no PHP / nextcloud app dev experience, don't have the debug tools to be able to narrow this down further without lots of guesswork. If someone can tell me how to print to the log file, I may be able to add more info.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions