Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom setting section not visible if used for admin and personal setting in NC14 #10764

Closed
sualko opened this issue Aug 20, 2018 · 4 comments · Fixed by #10861
Closed

Custom setting section not visible if used for admin and personal setting in NC14 #10764

sualko opened this issue Aug 20, 2018 · 4 comments · Fixed by #10861

Comments

@sualko
Copy link
Member

sualko commented Aug 20, 2018

In NC 13 everything works as expected, but in NC 14 my admin section is missing (the personal section is there). If I remove the personal-section element, the admin section is there. @juliushaertl thinks this is maybe a bug.

Here's an example of my info.xml:
https://github.com/nextcloud/jsxc.nextcloud/blob/9f342ec4455ad67f9960a152f28894dc22bd3490/appinfo/info.xml#L45-L50

ref jsxc/jsxc#718

Steps to reproduce

  1. Use the same section in your info.xml for admin-section and personal-section
  2. Go to settings in your NC

Expected behaviour

There is a custom section in personal and admin section.

Actual behaviour

Only the personal section is visible.

Server configuration

Operating system: ubuntu 18.04

Web server: apache

Database: sqlite

PHP version: 7.2

Nextcloud version: 14 beta.4

Updated from an older Nextcloud/ownCloud or fresh install: fresh

Where did you install Nextcloud from: git

Client configuration

Browser: Vivaldi

Operating system: ubuntu 18.04

Logs

Nextcloud log (data/nextcloud.log)

Nextcloud log

Nothing relevant.

Browser log

Browser log

Nothing.

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #3490 (Explain some Settings in Personal/Admin Settings), #1063 (Ability to search in Personal and Admin settings), #7578 ('Name' from Theming should not be used in 'Version' in the admin settings), #9003 (Admin settings restructuring), and #5332 (Consider about icon for "Security"-section in personal settings).

@sualko
Copy link
Member Author

sualko commented Aug 24, 2018

I implemented the following workaround, because I want to make my app NC 14 ready. Maybe it's helpful for your debugging. If you have questions, I'm at the NC conf until Monday.

class SectionWorkaround extends Section
{
}
<settings>
      <admin>OCA\OJSXC\Settings\Admin</admin>
      <admin-section>OCA\OJSXC\Settings\Section</admin-section>
      <personal>OCA\OJSXC\Settings\Personal</personal>
      <personal-section>OCA\OJSXC\Settings\SectionWorkaround</personal-section>
</settings>

@sualko
Copy link
Member Author

sualko commented Aug 24, 2018

I think I found the source of this issue:

public function registerSection(string $type, string $section) {
$this->sectionClasses[$section] = $type;
}

As the class is used as key, a section class can't be used for two different section types.

cc @nickvergessen

@nickvergessen
Copy link
Member

I do the same "workaround" in the activity app:
https://github.com/nextcloud/activity/blob/master/appinfo/info.xml#L51-L56

MorrisJobke added a commit that referenced this issue Aug 28, 2018
Allow same section class for multiple section types (fix #10764)
@MorrisJobke MorrisJobke added this to the Nextcloud 14 milestone Aug 28, 2018
@MorrisJobke MorrisJobke mentioned this issue Aug 30, 2018
6 tasks
weeman1337 pushed a commit to weeman1337/server that referenced this issue Sep 6, 2018
)

Signed-off-by: Klaus Herberth <klaus@jsxc.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants