Giter Club home page Giter Club logo

Comments (7)

smg6511 avatar smg6511 commented on September 23, 2024

Ok, so after a little research on this I found that the behavior has always been this way dating back to the introduction of profile photos nearly 10 years ago. The source combo was purposely hidden and a system setting (photo_profile_source) was added into the conditional that defines which source the media browser should use (in the context of profile photo insertion):

{
    id: 'modx-user-photo'
    ,fieldLabel: _('user_photo')
    ,name: 'photo'
    ,xtype: 'modx-combo-browser'
    ,hideFiles: true
    ,source: MODx.config['photo_profile_source'] || MODx.config.default_media_source
    ,hideSourceCombo: true
    ,anchor: '100%'
}

@rtripault was the author of the original code and may be able to shed some light on that decision (maybe ... it's been an awfully long time!).

Before proceeding on any changes, the question arises: Is this a bug, a missing feature, or a move made (to limit the source to the two settings-defined options) for good reason that we should stick with?

from revolution.

SnowCreative avatar SnowCreative commented on September 23, 2024

Ah, I was hoping there was a system setting but couldn't find it. That kind of makes sense, but I don't know why just using the normal media manager setup wouldn't work. I assume access to media sources would be limited by permissions set on each source, as it is in every other context of using the media manager. If anything is preventing that from being the case for profile photos, then I can see why a system setting would be needed. What would be nicest is to make the system setting optional: if something is entered there, then only show that media source; and if it's empty then show the full list in the browser.

from revolution.

rtripault avatar rtripault commented on September 23, 2024

That's an old one indeed!

Not sure what was the old me thinking back then... i guess ease of being able to render pictures in the frontend then... but having ability to pick the source definitely makes sense!

With current implementation, you might end up having a media source configured which some user might not have access too.

from revolution.

smg6511 avatar smg6511 commented on September 23, 2024

Alright, sounds like there's no reason not to add the sources dropdown. It'll involve a handful of adjustments and additions, which I could dig into in the next week or two...

from revolution.

smg6511 avatar smg6511 commented on September 23, 2024

After thinking on this a little more and batting it around with @opengeek, I've concluded that the best course of action would be:

  1. Show a disabled source dropdown in the media browser. This would keep the UI more consistent; I could also add a little hint via a tooltip or simply via a title attribute re the ability to customize the source via the photo_profile_source system setting. (That setting has always been available for choosing a photo source other than the default_media_source, but never installed.); and
  2. Add (install) the photo_profile_source setting into the predefined system settings. Right now, that special source is taken into account but, because it was never made available otherwise, one would never know it was there to take advantage of.

This should offer plenty of granularity via user group, context, and/or user settings.

BTW, the reason to not enable the sources dropdown: If we did that, we'd need to persist that source via a new column in the user profile; not a big deal, but it's really not the type of data we want to be storing there.

from revolution.

SnowCreative avatar SnowCreative commented on September 23, 2024

That setting has always been available for choosing a photo source other than the default_media_source, but never installed

Well no wonder I coudn't find it!

from revolution.

smg6511 avatar smg6511 commented on September 23, 2024

BTW, in the submitted PR I elected to not add a disabled source dropdown as, after another survey of how the Media Browser appears in other instances, it was more consistent to hide it than not.

from revolution.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.