Personal settings in OC


#1

Hello all,

I have an issue getting personal settings up and running.

I added a separate section to index.xml (different handling to NC which is handled in one section)

the personal settings is here

but the error in .log is
Interface 'OCP\\Settings\\IIconSection' not found at \/mnt\/usb\/var\/www\/owncloud\/apps\/audioplayer\/lib\/Settings\/PersonalSection.php#18"

any suggestion?


#2

AFICS there is no \OCP\Settings\IIconSection, but an \OCP\Settings\ISection.


#3

This is one of the sad stories where the APIs are no longer compatible between ownCloud and Nextcloud :cry:

In ownCloud you need to register the settings like this https://github.com/owncloud/core/blob/24b799903c9b21df604ab3f9a89fbb0d6bce0b9e/apps/files_external/appinfo/info.xml#L40

These panel classes are implemented in here: https://github.com/owncloud/core/tree/master/apps/files_external/lib/Panels

I fear you have to create two different packages with different info.xml

@Rello let me know if you need more support on this.


#4

thank you Thomas!
I finally got it working!

info.xml is actually not the issue. it looks kind of double when having an own section - NC is using the first one and oC the second one. As they can co-exist (just tested), its fine from an app-dev point of view

	<settings>
		<personal>OCA\audioplayer\Settings\Personal</personal>
		<personal-section>OCA\audioplayer\Settings\PersonalSection</personal-section>
	</settings>
	<settings-sections>
		<personal>OCA\audioplayer\Settings\PersonalSection</personal>
	</settings-sections>

within Personal.php you need two functions returning the same. again double - but ok.

public function getSection() **NC**
public function getSectionID() **oC**

If an app only uses one of the existing categories - you are done here.
But it gets interesting when using an own section


within PersonalSection.php, there are 2 basic differences.

class PersonalSection implements ISection **oC extended with getIconName()**
class PersonalSection implements IIconSection **NC extendet with getIcon()**

So this would be the time to introduce two different PersonalSettings.php
Or do you have a suggestion to evaluate if the one or the other class is available?


#5

the happy result…
04


#6

Cool! Congrats! I’m glad you got it working!