< 302019-07-01⋎02 >

farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Feature requests and bug reports: github.com/farmOS/farmOS/issuesSet by ChanServ on 2018-08-16 at 14:32
10:17karna[m]Hey Mike, can you suggest how I go about batch adding users who I'm migrating over from our old site? I have usernames and emails and can randomly generate passwords which will be e-mailed out to them
10:17karna[m]I would then like to use the quick form I've created/modified to add assets for and attribute to them to a specific area which I will point to co-ordinates derived from the postcode data I have and allow users to geometrically plot their growing space
10:22karna[m]I'm thinking I reconfigure my modular quick form such that it allows the creation of new users in it too and then run a script to batch add all of my people/asset/area data. The only thing I'm unsure about is how I go about attributing assets/areas to a person
10:22karna[m]like how I can have the form handle that
12:51mstenta[m]karna: You might want to look into Drush
12:51mstenta[m]www.drush.org/
12:51mstenta[m]It is a command line utility for Drupal
12:52mstenta[m]One of the commands/tools it comes with allows you to run an arbitrary PHP script from the command line
12:52mstenta[m]So you could create a script that creates all your users, called create-users.php
12:52mstenta[m]Then run `drush php-script create-users.php`
12:53mstenta[m]And it will run the script in a fully-bootstrapped Drupal context (so you have access to all Drupal functions, database, etc)
12:53mstenta[m]> The only thing I'm unsure about is how I go about attributing assets/areas to a person
12:53mstenta[m]As for this (attributing assets/areas to a person)...
12:54mstenta[m]farmOS does have a user ID column in the {farm_asset} database table
12:54mstenta[m]Currently that is not used/displayed anywhere in farmOS - but it does automatically store the user ID of the person who created the asset
12:55mstenta[m]Areas, on the other hand, do not have any way of being assigned to a particular person currently
12:55mstenta[m]This is something that's come up before, though - so we should open a feature request for it and discuss
12:55mstenta[m]In the meantime, you could consider adding your own database table via a custom module, which maintains an association between areas and users
12:56mstenta[m]Check out Drupal's hook_schema() for adding database tables: api.drupal.org/api/drupal/modules%21syst
15:52mstenta[m]FYI: twitter.com/farmOSorg/status/11457213878
20:25*JustTB has joined
21:55karna[m]mstenta: nice one Mike, thanks for laying it out the steps so clearly for me ^_^ will get to work on it tomorrow
22:01mstenta[m]Sure thing! Good luck @karna:matrix.org

< 302019-07-01⋏02 >