IRC logs for #farmOS, 2021-03-06 (GMT)

2021-03-05
2021-03-07
TimeNickMessage
[21:53:17]* farmBOT has joined #farmos
[06:36:23]* skipper_is[m] has joined #farmos
[06:47:19]<skipper_is[m]>o/ Morning. I'm trying to hook into farm_asset_form_alter, but nothing is being returned.... Does it need declaring somewhere?
[06:54:48]<skipper_is[m]>I've used the eggs module as an example, but it doesn't seem to work...
[06:54:54]<skipper_is[m]>Cannot figure out why
[07:18:54]<skipper_is[m]>..So it turns out that it was an ID 10 T error... Didn't Clear Caches....
[07:48:11]<mstenta[m]>Ah ha! When in doubt... ;-)
[07:48:57]<skipper_is[m]>Yup :) Is there a human readable time since formatter?
[07:49:33]<skipper_is[m]>Like there is a JS module called Moment.js, that you can have time since formatted like "1 Day, 2 Hours and 36 secons"
[07:50:31]<mstenta[m]>I think there's a "custom" option that let's you use PHP date() string options
[07:51:16]<mstenta[m]>https://www.php.net/manual/en/datetime.format.php
[07:51:25]<mstenta[m]>Oh wait I might be confusing that with something else
[07:53:33]<mstenta[m]>https://drupal.stackexchange.com/questions/199280/how-can-i-use-xx-time-...
[07:53:39]<mstenta[m]>Maybe some options there
[08:18:06]<skipper_is[m]>Yea, I'll have a look
[08:18:34]<skipper_is[m]>Otherwise, can we use external js modules in Drupal?
[08:21:17]<mstenta[m]>Yup! Just a matter of adding the JS (drupal_add_js()) and modifying the markup to match
[08:21:41]<skipper_is[m]>Ah sweet, I'll probably just use moment.js then
[08:21:57]<mstenta[m]>Sometimes modifying the markup is the tricky part. Depending on what you're trying to override
[08:22:21]<skipper_is[m]>For flags, how do we get the formatting?
[08:22:57]<skipper_is[m]>A list of particular logs (hoof trimming logs) with the days since it was completed
[08:23:19]<skipper_is[m]>Or rather, a list of animals and when they last had their hooves trimmed
[08:41:28]<skipper_is[m]>Also, in forms, is there just a text element? Not editable, but just some content?
[09:18:13]<skipper_is[m]>...And searching logs? Is there a nice function for finding logs with x title and x assets?
[10:07:03]<mstenta[m]>> Also, in forms, is there just a text element? Not editable, but just some content?
[10:07:03]<mstenta[m]>Yes #markup
[10:07:54]<mstenta[m]>https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.h...
[10:08:05]<mstenta[m]>> For flags, how do we get the formatting?
[10:08:06]<mstenta[m]>Not sure I understand
[10:08:20]<mstenta[m]>> ...And searching logs? Is there a nice function for finding logs with x title and x assets?
[10:08:20]<mstenta[m]>From within a form you mean?
[10:10:40]<skipper_is[m]>Yea, or just within a module/php.
[10:11:14]<skipper_is[m]>Used farm_log_asset_query
[10:11:36]<skipper_is[m]>and innerjoin on notes
[10:12:48]<skipper_is[m]>Oh with the flags, so in the log list there is the flags for the logs. It has a specific formatting (with the colours etc), is there a way of just pulling in the flag styling into a form/markup?
[10:13:57]<mstenta[m]>Hmm what's the end goal?
[10:14:31]<mstenta[m]>(I'm out right now but will add thoughts as I can)
[10:16:21]<skipper_is[m]>So my quick form will have two parts - one being a simple form to log hoof trimmings, the other is previous hoof trimming records - with the most recent for each animal being listed. If someone has flagged the log as "Monitor", i'd like that flag to be visible in my hoof trimming record list at the bottom. At the moment this list is pure html - just
[10:16:21]<skipper_is[m]>Animal 1: Date trimmed - Some notes here (Monitor Flag)
[10:16:22]<skipper_is[m]>Animal 2: Date trimmed - some other notes here
[11:00:10]* trishlatalera[m] has quit (Quit: Idle for 30+ days)
[16:22:40]* mstenta[m] has quit (Ping timeout: 265 seconds)
[16:22:46]* mstenta[m] has joined #farmos
[18:38:47]* svenn_ has quit ()
[18:40:12]* svenn has joined #farmos