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

Updates to Mediawiker delete custom wiki entries in sublime-settings file. #178

Closed
biggestsonicfan opened this issue May 10, 2021 · 4 comments

Comments

@biggestsonicfan
Copy link

biggestsonicfan commented May 10, 2021

Greetings again. I initially posted my issue with a custom wiki in issue #171, however I had received an update to Mediawiker shortly after that. I have recently gone back to work on my wiki entries again and noticed that none of the Edit Panel functions were working. I thought that my issue regarding link suggestions was resolved, but in actuality, Mediawiker was not connected to any wiki at all.

My site_active settings remained the same, being TCRF, however a TCRF entry no longer exists due to the update. As such, Mediawiker threw no errors at all informing me of this, and simply silently failed at everything I tried to tell it to do, such any option in the Edit Panel that involves interacting with the wiki. The only error messages displayed where when I attempted to open a template for a new page, in which case this error was thrown:

  >>> Path to template does not defined, please set this via "new_page_template_path" option
  >>> Traceback (most recent call last):
  >>>   File "/home/rob/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_utils.py", line 762, in get_connect
  >>>     site = self.get_site(name)
  >>>   File "/home/rob/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_utils.py", line 719, in get_site
  >>>     self.get_site_config(name=name)
  >>>   File "/home/rob/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_utils.py", line 655, in get_site_config
  >>>     site_config = props.get_site(name)
  >>>   File "/home/rob/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_properties.py", line 289, in get_site
  >>>     if site_settings.get('parent'):
  >>> AttributeError: 'NoneType' object has no attribute 'get'
  >>> Traceback (most recent call last):
  >>>   File "/home/rob/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_utils.py", line 762, in get_connect
  >>>     site = self.get_site(name)
  >>>   File "/home/rob/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_utils.py", line 719, in get_site
  >>>     self.get_site_config(name=name)
  >>>   File "/home/rob/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_utils.py", line 655, in get_site_config
  >>>     site_config = props.get_site(name)
  >>>   File "/home/rob/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_properties.py", line 289, in get_site
  >>>     if site_settings.get('parent'):
  >>> AttributeError: 'NoneType' object has no attribute 'get'
  >>> Path to template does not defined, please set this via "new_page_template_path" option

So I guess I am wondering if I can define a site in the User folder so the site is not overwritten by updates.

It should also be noted that if the suggested fix #171 (comment) were implemented and changed "page_prefix_min_length": 100 it would be defaulted to "page_prefix_min_length": 3 after an update.

EDIT: After idling about in a .wiki file that I had previously used the "Open Page" function with, it now occasionally throws this error in the console:

  >>> Traceback (most recent call last):
  >>>   File "/home/rob/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_utils.py", line 762, in get_connect
  >>>     site = self.get_site(name)
  >>>   File "/home/rob/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_utils.py", line 719, in get_site
  >>>     self.get_site_config(name=name)
  >>>   File "/home/rob/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_utils.py", line 655, in get_site_config
  >>>     site_config = props.get_site(name)
  >>>   File "/home/rob/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_properties.py", line 289, in get_site
  >>>     if site_settings.get('parent'):
  >>> AttributeError: 'NoneType' object has no attribute 'get'
@tosher
Copy link
Owner

tosher commented May 10, 2021

Preferences/Package settings/Mediawiker/Settings opens two tabs with settings.

Default on the left side, User settings on the right.

@biggestsonicfan
Copy link
Author

biggestsonicfan commented May 11, 2021

Correct. My defaults were overwritten. That is where the site variable is located. I had assumed this is where you add sites as variables such as "English wikipedia" and "Mediawiki" are located. Is this an incorrect assumption?

Is a second site variable supposed to be added to the user settings? If so there is no clear documentation on that.

EDIT: And as previously stated, if the defaults are overwritten, such as "page_prefix_min_length": 3 does that mean a second variable in the user settings will override the default?

@tosher
Copy link
Owner

tosher commented May 11, 2021

All your settings, including site and any other, must be in the user-settings, default config must never be changed. User settings overrides defaults.

This scheme works in all ST plugins.

@biggestsonicfan
Copy link
Author

Huh, never knew that. Alright then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants