User profile fields: Dropdown dynamic menu

profilefield_dynamicmenu
Maintained by Picture of Antonello Moro Antonello Moro
Dynamic menu user profile field for moodle Now users can create user menu fields whose values are retrieved from the moodle DB.
318 sites
302 downloads
30 fans
46 sites
28 downloads
11 fans
Dynamic menu user profile field for moodle. Now users can create user menu fields whose values are retrieved from the moodle DB. Basically, the user can set a sql query as value definition of the field. Please note that the query *must* return two fields: id and data. Please note that this is an advanced plugin, mainly intended for developers and very advanced moodle users. You must know moodle DB and sql language to use this plugin properly.

Screenshots

Screenshot #0
Screenshot #1

Contributors

Picture of Antonello Moro
Antonello Moro (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Dan Marsden
    Fri, Apr 29, 2016, 6:12 PM
    Hi Antonello,

    I managed to get your plugin working and I can see some places where it could be quite useful - great work!

    Initially I was curious why you were storing the "key/id" value in the field instead of the actual text/data from the query? - I assume it is so that you can allow the data field to be updated in the external table and not need to modify the data stored in the field to match. The drawback with this is that each time the field is displayed it requires the sql to be called and in some cases the profilefield constructor is called multiple times on a single page load which then makes your sql run multiple times as well. I've reported some information about that in github but you should make sure that your use-cases/examples and description in the plugins entry describes that you have implemented it with an id/data field to allow the data field to be updated.

    for now we will mark your plugin as requiring more work - please let us know when you have had a chance to look at the issues found and upload a new version for us to review.

    thanks!
  • Picture of Antonello Moro
    Fri, Apr 29, 2016, 6:29 PM
    Hi Dan,
    Thanks for your help! I'll do my best to fix everything as soon as possible!
  • Picture of Dan Marsden
    Tue, May 3, 2016, 5:56 AM
    Thanks for tidying up those issues Antonello, I still think it would be nice if you could expand your description here a little bit more to explain the different use-cases (to help encourage more people to try out your plugin) but I think the plugin code is ready for approval - we'll just wait for the Moodle HQ team to make the final decision on approval.
  • Picture of Antonello Moro
    Wed, May 4, 2016, 6:11 PM
    ok thanks Dan. In the meantime I'll think about some use-cases to expand the description
  • Picture of David Mudrák
    Mon, May 9, 2016, 5:01 PM

    Thanks Antonello for sharing the plugin with the Moodle community, and thanks Dan for the detailed peer-review. I am happy to approve the plugin now. You are cleared to land, welcome to the Plugins directory!

  • Picture of Antonello Moro
    Mon, May 9, 2016, 5:24 PM
    Thanks guys!
  • Picture of eli chan
    Fri, Oct 7, 2016, 10:28 AM
    Very useful plugin after installation and work prefectly, but new course cannot add activity due to "Error reading from database".
  • Picture of Ibrahim Fadl
    Wed, Dec 7, 2016, 7:14 PM
    I am new to moodle, how to select all moodle users email addresses to this dynamic menu
  • Picture of Saaid Agherdien
    Sat, Dec 31, 2016, 6:15 PM
    Hi eli chan, I had the same issue with the dynamic multi select profile field. That is, it worked fine until I deleted a user that used the multi select to update his profile. After this I could not add activities to courses as I would get "error reading from database". I think that when I deleted the user, it did not clean up the database. To solve the problem I deleted the multi select field I created. I can now add activities to any course.
  • Picture of Antonello Moro
    Sun, Feb 12, 2017, 11:25 PM
    Hi folks, those issue should be fixed in the new version 1.1.0
  • Picture of Valentino Santucci
    Fri, Jul 28, 2017, 5:45 AM
    Hi, it does not work in the signup page (no option), while it is ok in the user profile page. Am I doing something wrong?
  • Picture of John Anderson
    Thu, Sep 14, 2017, 12:18 AM
    Hi, I have a question /idea about use case. I am facing a requirement to report on what sorts of learners, by license, credential, or age that completed course X. I don't have these fields in my moodle and was struggling to devise a plan to do this. I was thinking about using a feedback activity to collect this at the start of the course. Then use configurable reports to query out the data. But wondering if this might be used to store my feedback activity data into some profile fields?

    Any ideas welcome - interesting module !
  • Picture of Muneera AlNufaisi
    Sat, Jul 21, 2018, 4:08 AM
    is better if I can write full query that get form database rather than currnt way
  • Picture of David Collins
    Thu, Aug 23, 2018, 10:36 PM
    I am having the same issue as Valentino. Looking over your code, in the constructor for the field, you have a parameter for userID, which is null/empty from the sign-up page, so it never hits the code path to populate the dropdown.
  • foto_frank
    Wed, Jan 2, 2019, 3:37 AM
    Hi, thanks for sharing. How do I uninstall it?
1 2
Please login to post comments