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

fix app_type check #29110

Closed
wants to merge 1 commit into from
Closed

fix app_type check #29110

wants to merge 1 commit into from

Conversation

phisch
Copy link
Contributor

@phisch phisch commented Sep 27, 2017

Description

Currently we have no way to get all apps of a certain type that includes apps that have never been enabled before.

When getting a list of all themes, the AppManager does only look into the appconfig table to get a list of apps. This means apps that have never been enabled will not get returned by the AppManager. That's why i am using the legacy OC_App::getAllApps() which iterates over the fs.

When checking if an app has a specific app_type, we only ever look into the appconfig table as well. That is why I included a check to also look into the info.xml whenever there is nothing in the appconfig table and also add the found types to the static list of app types, so they will be available through self::getAppTypes($app).

To be clear, this is a hack. It will add unreasonable fs reads, but it is necessary for the Templateeditor to work properly.

@DeepDiver1975 @PVince81 we should talk about a small refactoring of the app structure or how to extend the AppManager so even never enabled apps are properly available in the code.

Related Issue

owncloud/templateeditor#52

How Has This Been Tested?

manual only

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@PVince81
Copy link
Contributor

@phisch why would it be necessary to get app types of apps that have never been enabled before ? From what I understand only enabled apps / theme apps are of interest here ?

@phisch
Copy link
Contributor Author

phisch commented Oct 11, 2017

@PVince81 there is the possibility that a theme has never been enabled, for example if you install a fresh ownCloud with lets say the enterprise theme, the example theme and a custom one. Usually this would not be a problem, since there is no component in the code that needs a list of all apps, enabled or disabled, filtered by the type.

The TemplateEditor does need such a list though. It needs to grab all apps that are of the type Theme.

Currently the ThemeManager provides a function to return all Themes, and that fails with never enabled themes. (just doesn't return those themes)

@PVince81
Copy link
Contributor

Why does the template editor need to list theme apps that were never enabled ? I don't think the template editor should let you edit templates from disabled apps anyway

@PVince81 PVince81 modified the milestones: development, planned Nov 3, 2017
@PVince81 PVince81 modified the milestones: planned, development Nov 22, 2017
@DeepDiver1975
Copy link
Member

@ownclouders rebase

…types are available, update app types when setting them
@ownclouders
Copy link
Contributor

Hey! This pull request is being rebased automatically. Please DO NOT push while rebase is in progress or your changes would be lost!

@ownclouders
Copy link
Contributor

Automated rebase was successful!

@DeepDiver1975
Copy link
Member

@VicDeo I assigned you since you took over the tasks from @phisch

@codecov
Copy link

codecov bot commented Nov 24, 2017

Codecov Report

Merging #29110 into master will increase coverage by <.01%.
The diff coverage is 80%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #29110      +/-   ##
============================================
+ Coverage     62.15%   62.16%   +<.01%     
- Complexity    17516    17517       +1     
============================================
  Files          1045     1045              
  Lines         57740    57744       +4     
============================================
+ Hits          35890    35895       +5     
+ Misses        21850    21849       -1
Impacted Files Coverage Δ Complexity Δ
lib/private/Theme/ThemeService.php 62.68% <0%> (ø) 31 <0> (ø) ⬇️
lib/private/legacy/app.php 58.95% <100%> (+0.51%) 202 <0> (+1) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d750519...4ea736b. Read the comment docs.

@VicDeo
Copy link
Member

VicDeo commented Dec 18, 2017

@PVince81 we agreed that only enabled app-theme should be editable with Templateeditor.
Close?

@PVince81 PVince81 closed this Dec 19, 2017
@PVince81 PVince81 deleted the app_types_never_enabled_apps branch December 19, 2017 09:29
@lock
Copy link

lock bot commented Aug 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants