< 082020-04-09⋎10 >

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
00:30*JustTB has quit (Ping timeout: 265 seconds)
00:44*JustTB has joined
06:45*JustTB has quit (Quit: Leaving.)
08:07skipper_is[m]I've found something called dbtng, which apparently can migrate between multiple different database types, so going to give it a try for postgres>mysql
08:16skipper_is[m]Actually, that works really well. If anyone is looking to migrate, dbtng. Absolutely flawles
08:16skipper_is[m]With an extra s on the end..
10:11*JustTB has joined
11:08*JustTB has quit (Quit: Leaving.)
11:16mstenta[m]wow!
11:16mstenta[m]oh that's great news skipper_is !
11:16mstenta[m]so you were able to successfully migrate?
11:31*JustTB has joined
12:08skipper_is[m]Yup, running on mySQL now with no errors
12:10mstenta[m]woo hoo!
12:10mstenta[m]that's great
12:10mstenta[m]oh... so at some point in the future...
12:11mstenta[m]remember that issue we discovered with the sensor data denominator?
12:11mstenta[m]where it was a bigint instead of an int?
12:12skipper_is[m]Yea, I assume that because it isn't really touching the database itself, it is letting drupal manage the db, it can get away with it
12:12mstenta[m]we have a patch almost ready to test
12:12mstenta[m]that will fix it
12:13mstenta[m]or... oops... sorry... i mean "signed" vs "unsigned" (not bigint)
12:14mstenta[m]anyway... we have a fix
12:14mstenta[m]but... it may require running a query manually on your data to trim the values
12:14mstenta[m](if i remember correctly)
12:15mstenta[m]so i can help you through that when the time comes...
12:15mstenta[m]might take a quick look at it right now... it's just waiting for my review/tests
12:38skipper_is[m]Yea, I mean now my main production site is on mysql, so my Postgresql install is pretty much frozen as of this morning
12:38mstenta[m]ok cool
12:39mstenta[m]well what i might have you do (when you have some time), is create a testing site that is a clone of your mysql database, so we can run the update and test it with your data
13:01mstenta[m]actually skipper_is can you run this query real quick?
13:01mstenta[m]`SELECT MAX(value_denominator) FROM farm_sensor_data;`
13:03skipper_is[m]Yea, just fire up pgadmin now
13:04mstenta[m]ah no... in mysql
13:04skipper_is[m]10000000
13:04skipper_is[m]ah
13:04mstenta[m]or either i guess
13:04mstenta[m]but ultimately you'll be running the update on the mysql db
13:05mstenta[m]ooh. huh. i thought we ran into an issue with your values being too big... ?
13:05skipper_is[m]Output from SQL command SELECT MAX(value_denominator) FROM farm_sensor_data; ..
13:05skipper_is[m]MAX(value_denominator)
13:05skipper_is[m]10000000
13:05skipper_is[m]Yea, I think I deleted the ones that were too big
13:05mstenta[m]or did you run a query to fix that already?
13:05skipper_is[m]I cannot remember now..
13:06skipper_is[m]But a lot of them were running to like 10 digits of precision for temperature
13:06mstenta[m]it was when we were trying to migrate from pgsql to mysql earlier... it choked on your farm_sensor_data table, which led us to discover that on postgres it was a `bigint` when it should have been an `int`... and you had been pushing sensor data to it that had insanely high decimal precision :-)
13:08skipper_is[m]Yea, I think I dumped a load of data to get it to go across
13:08mstenta[m]ahh ok - that would explain it :-)
13:08mstenta[m]cool - then that means you won't run into any issue when you update
13:08mstenta[m]so you can ignore everything i said above :-)
13:09skipper_is[m]Yea, shouldn't do. It seems to be running quite smoothly on mysql, which is a suprise
13:09mstenta[m]i just had a mental note to help you with that update, but sounds like that won't be necessary :-)
13:09mstenta[m]mental note erased
13:09skipper_is[m]Yea, that module was really impressive, no errors at all
13:10skipper_is[m]I was expecting it to throw a wobbler and complain about postgresql at least once
13:10mstenta[m]in either case... the next version of farmOS will fix the issue that was causing postgres to create `bigint` denominators... so one more postgres issue fixed ;-)
13:10skipper_is[m]Ah nice
13:11skipper_is[m]farm_livestock.features.field_base.inc is the form rather than the view/profile?
13:23mstenta[m]Ah not quite... Drupal has a distinction between a "Field Base" definition and a "Field Instance" configuration. The Base defines the type of field (eg: textfield), and the Instance (which is always an instance of a specific Base), defines what entity type + bundle the field is attached to, and the specific widget and display settings for it
13:23mstenta[m]the "widget and display" correspond to the "form and view"
13:23mstenta[m]so the widget and display settings are actually in `farm_livestock.features.field_instance.inc`
13:24mstenta[m]`farm_livestock.features.field_base.inc` is just there to say "these are the base fields that the livestock module provides"
13:24mstenta[m]while `farm_livestock.features.field_instance.inc` says "and this is specifically where those fields are added to entities"
13:24mstenta[m]if that makes sense
13:25mstenta[m]are you trying to add a field?
13:42*bonushenricus[m] has joined
13:45bonushenricus[m]Hello. Do I have to create a room on purpose for the translation?
13:46mstenta[m]Hi bonushenricus - no let's chat here
13:47mstenta[m]Regarding the ARVAIA site: are you seeing ANY translated strings? Or is it all English for you?
13:48bonushenricus[m]Not only in english. But i.e. "Upcoming tasks" the approved translation here localize.drupal.org/translate/languages/ is "Compiti imminent" but there isnt' translation of this string in arvaia.farmos.net
13:49mstenta[m]Ah I see - OK...
13:50mstenta[m]Hmm I wonder if it takes time for approved translations to be available in the downloaded updates?
13:50mstenta[m]Let me take a look at the files directly on the server...
13:54*posted a file: farm-7.x-1.3.it (2).po (186KB) < matrix.org/_matrix/media/r0/download/mat >
13:54bonushenricus[m]Thank you! The file export from here localize.drupal.org/translate/languages/ (I attach the file) runs
13:54mstenta[m]Oh hmm... ok so it looks like the `farm` project `.po` file was not downloaded automatically
13:54mstenta[m]Is that what you experienced too when you were working on it?
13:55bonushenricus[m]Monday. A some little translation not important Tuesday.
13:56bonushenricus[m]Sorry. Yes in my localhost this file runs. From the admin.
13:57bonushenricus[m]In import "regional and laguages"
13:59bonushenricus[m]Translate interface with import tells me "589 strings were updated"
14:00mstenta[m]Ok
14:00mstenta[m]I'm also trying to understand why they were not downloaded automatically
14:01bonushenricus[m]I'm in no hurry. it is not a big deal now. It is to understand.
14:01mstenta[m]I imported it on ARVAIA
14:03mstenta[m]Upcoming tasks still isn't translated though... hmm
14:04bonushenricus[m]Maybe import in "translate interface" with check of "Strings in the uploaded file replace existing ones, new ones are added. The plural format is updated."?
14:11mstenta[m]Hmm I've tried both options - still "Upcoming tasks" is not translated :-(
14:12bonushenricus[m]With file that I attach before here?
14:12mstenta[m]yes
14:12bonushenricus[m]I don't understand
14:13mstenta[m]Oh! Now it is!
14:13mstenta[m]I cleared the Drupal cache and that seemed to update it
14:13bonushenricus[m]Yes!!
14:14mstenta[m]So now what I want to understand is how to automate this... so that I don't need to manually import in the future
14:14mstenta[m]Where are the .po files downloaded in your local testing site?
14:14mstenta[m]I have mine configured to download them to sites/all/languages
14:15mstenta[m]but the `farm` po file doesn't get downloaded there
14:16mstenta[m](oh... I will also import for the other two sites now too...)
14:20bonushenricus[m]here: /var/www/html/FarmOS/sites/default/files/languages in a file named it_ZoQ2XItBGwYYtPDZNYjVpup3Sjb02dqQvcoXgMv_AjQ.js
14:22bonushenricus[m]with a code with this form <<Drupal.locale = { 'pluralFormula': function ($n) { return Number(($n!=1)); }, 'strings': {"":{"[english]":"[italian]",}} };>>
14:33mstenta[m]bonushenricus: strange.... i was able to get it working on bonushenricus... but not on agroecologia
14:33mstenta[m]doing the same exact procedure
14:33*sent a long message: < matrix.org/_matrix/media/r0/download/mat >
14:33mstenta[m]so i am still a bit confused
14:34mstenta[m]Ok thanks!
14:34mstenta[m]talk to you later
14:35mstenta[m]The very strange thing... I am seeing different numbers/percentages of translated strings on each site...
14:37mstenta[m]arvaia: 8191/10939 (74.88%)
14:37mstenta[m]bonushenricus: 8167/10362 (78.82%)
14:37mstenta[m]agroecologia: 8167/10777 (75.78%)
18:24*farmBOT has joined
18:26*JustTB has quit (Ping timeout: 250 seconds)
18:41*JustTB has joined
18:43skipper_is[m]Still no idea why my map is on top of everything else.. including the menu
18:49mstenta[m]Hmm
18:49mstenta[m]paul121 was having another issue... not the same, but also with the map
18:49*Dorn[m] has joined
18:49mstenta[m]His isn't showing at all
18:49mstenta[m]What browser/OS are you using skipper_is ?
18:50skipper_is[m]Chrome
18:50skipper_is[m]If I go on block settings, what should the region settings be for the map?
18:50mstenta[m]Can you post a screenshot?
18:51*uploaded an image: image.png (89KB) < matrix.org/_matrix/media/r0/download/mat >
18:52mstenta[m]ah right ok... and you don't see the "toggle map" link?
18:52mstenta[m]are the base layers not working either?
18:52skipper_is[m]No, that was just a screenshot from march without the base layers
18:53skipper_is[m]But the map looks the same, just with layers
18:53skipper_is[m]If I go on the little cog in top right, it says edit blocks
18:53skipper_is[m]or configure block
18:53mstenta[m]oh ok - so you got those working
18:53skipper_is[m]There is something about the location/region
18:54mstenta[m]try setting that to -none-
18:54skipper_is[m]err, it has gone
18:54*uploaded an image: image.png (67KB) < matrix.org/_matrix/media/r0/download/mat >
18:55*uploaded an image: Screenshot from 2020-04-09 14-54-42.png (57KB) < matrix.org/_matrix/media/r0/download/mat >
18:55mstenta[m]hmm strange
18:56skipper_is[m]Top bar seems to work ok
18:57mstenta[m]`SELECT * FROM block WHERE delta = "farm_map";`
18:57mstenta[m]what does that give you
18:57skipper_is[m]41farm_mapfarm_mapfarm_theme10header01<front> farm/assets/*
18:57skipper_is[m]-1
18:58mstenta[m]| 110 | farm_map | farm_map | farm_theme | 1 | 0 | page_top | 0 | 1 | <front>
18:58mstenta[m]farm/assets/* | | -1 |
18:58mstenta[m]ok... try:
18:58mstenta[m]`UPDATE block SET region = "page_top" WHERE delta = "farm_map";`
18:58skipper_is[m]My PG build says page top
19:00*uploaded an image: image.png (295KB) < matrix.org/_matrix/media/r0/download/mat >
19:02mstenta[m]ok what does this say: `SELECT * FROM block WHERE module = "menu" AND delta = "farm";`
19:02mstenta[m]mine is:
19:02mstenta[m]`| 83 | menu | farm | farm_theme | 0 | 0 | -1 | 0 | 0 | | | -1 |`
19:02mstenta[m]is your region -1?
19:02skipper_is[m]1menufarmfarm_theme00-100
19:02skipper_is[m]-1
19:03mstenta[m]ok
19:03skipper_is[m]Yea
19:04mstenta[m]ok let's look at the html...
19:05skipper_is[m]Map is in the div region region-page-top
19:05mstenta[m]ok good
19:06mstenta[m]huh. i'm just noticing that `<div class="region region-page-top">` is above `<header id="navbar" role="banner" class="navbar navbar-fixed-top navbar-default">` in the markup
19:06mstenta[m]so that's probably part of it...
19:06skipper_is[m]But <header> with the nav bar in is at the bottom..
19:06skipper_is[m]Yea, mine too
19:06mstenta[m]are the CSS classes that same on your `<header>`?
19:06skipper_is[m]I just moved it, and it all went to the right place
19:07skipper_is[m]navbar container-fluid navbar-default
19:07mstenta[m]`navbar navbar-fixed-top navbar-default` ?
19:07skipper_is[m]is my header class
19:07mstenta[m]AHHH
19:07mstenta[m]`navbar-fixed-top`
19:07mstenta[m]that's what it should be
19:07mstenta[m]maybe you played around with the theme settings at some point??
19:08mstenta[m]go to `/admin/appearance/settings/farm_theme`
19:08skipper_is[m]quite possibly, not recently
19:08mstenta[m]click on "Components", then "Navbar", and set it to "Fixed top"
19:08skipper_is[m]Ayyy!
19:09*uploaded an image: image.png (170KB) < matrix.org/_matrix/media/r0/download/mat >
19:10skipper_is[m]Much appreciated!
19:10mstenta[m]hooray!
19:10mstenta[m]ok so... there's still a little space there that shouldn't be there...
19:10mstenta[m]but that's a known issue i saw recently
19:10mstenta[m]so i still need to fix it
19:10mstenta[m]also... i'm not seeing the "toggle map" link still
19:11mstenta[m](or is it just cut off in the screenshot?)
19:11skipper_is[m]Its not in the screenshot
19:11skipper_is[m]it is there
19:11mstenta[m]oh great
19:11mstenta[m]so that link will collapse the map, and it will remember that state in browser localstorage so you won't see the map if you reload
19:21mstenta[m]skipper_is: here is the fix for the spacing github.com/farmOS/farmOS/commit/6bab9986
19:21mstenta[m]just committed
19:45skipper_is[m]Is there a simple way of migrating/exporting/moving individual assets between farms?
19:46paul121[m]Shall I check the farm theme settings as well? It wasn't working from a fresh install... I don't think I would have modified anything...
20:00mstenta[m]paul121: no i doubt it's the same for you
20:00mstenta[m]but i might be able to help debug that right now if you have a few moments
20:00mstenta[m](naptime might end at any time too... so no guarantees)
20:01mstenta[m]skipper_is: "simple"... not really
20:01mstenta[m]but that could be done by writing a python script
20:06mstenta[m]@pa
20:06mstenta[m]paul121: try this command...
20:06mstenta[m]`sudo docker exec -it farmos_www_1 drush sql-query 'SELECT * FROM block WHERE delta = "farm_map"'`
20:06mstenta[m](that's assuming you are using the `farmos/farmos:dev` docker image (with drush) and the container is named `farmos_www_1`
20:06mstenta[m] * (that's assuming you are using the `farmos/farmos:dev` docker image (with drush) and the container is named `farmos_www_1`)
20:20paul121[m]sorry just getting back from lunch in the sun :-)
20:21paul121[m]that gives me:
20:21paul121[m]`1 farm_map farm_map farm_theme 0 0 -1 0 0 -1`
20:39mstenta[m]ah ok that could be the problem...
20:44mstenta[m]Sorry kids dance party
20:44mstenta[m]Brb :-)
20:52mstenta[m]try:
20:52mstenta[m]sudo docker exec -it farmos_www_1 drush sql-query 'UPDATE block SET region = "page_top" WHERE delta = "farm_map"'
20:52mstenta[m]paul121: question... did you say this happened to you on multiple fresh installs?
20:53paul121[m]yeah, this would be two relatively recent fresh installs
20:53paul121[m]one I installed yesterday, the other maybe a week ago?
20:53paul121[m](since we released OAuth to the dev image)
20:54mstenta[m]ok hmm
20:54mstenta[m]well see if that helps...
20:54mstenta[m]but we should probably open a bug report
20:54mstenta[m]and figure out why it's happening in the first place
20:56paul121[m]hmm. that doesn't seem to fix it
20:56mstenta[m]i also wonder if there's something wrong with the docker image itself - or the copy of it you have
20:56mstenta[m]hmm ok
20:56mstenta[m]try clearing cache?
20:57mstenta[m]`sudo docker exec -it farmos_www_1 drush cc all`
20:57paul121[m]yea tried that
20:58mstenta[m]oh hmmm...
20:58mstenta[m]did you change the homepage?
20:58mstenta[m]err... no nevermind
20:58mstenta[m]that wouldn't do it
20:58paul121[m]I can tell that `farmOS-map.js` and related js files aren't loaded
20:59paul121[m]when loading the default dashboard page
20:59paul121[m]so... server is choosing not to render it?
21:00mstenta[m]That makes sense if the block isn't being displayed
21:01mstenta[m]Look in htmlt
21:01mstenta[m]In the region top div
21:01mstenta[m]I assume the map block is not in there
21:03paul121[m]there is just a '<nav class='navbar-administration'...`
21:03paul121[m] * there is just a `<nav class='navbar-administration'...`
21:04mstenta[m]Ok let's look at code
21:04mstenta[m]github.com/farmOS/farmOS/blob/7.x-1.x/mo
21:05mstenta[m]That's where the block is defined
21:05mstenta[m]Make sure you have that, first of all
21:06paul121[m]yeah, that code is there
21:06mstenta[m]Ok
21:08mstenta[m]Do you have devel module?
21:08mstenta[m]Or xdebug working?
21:08paul121[m]I have devel
21:09paul121[m]xdebug used to work... not rn
21:10mstenta[m]oh i have another idea...
21:18mstenta[m]ok... yea i think i know what's happening... not sure why though
21:18mstenta[m]Open this function: github.com/farmOS/farmOS/blob/7.x-1.x/th
21:19mstenta[m]basically, the `farm_map` module provides the block, but does not turn it on or put it into any theme regions (because module's shouldn't be aware of themes)
21:19mstenta[m]so... `farm_theme` implements `hook_block_info_alter()` to add the map block to the farmOS theme
21:20mstenta[m]and it seems like THAT hook is not firing for you
21:20mstenta[m]because in the `block` database table record, none of those overrides are there.
21:20mstenta[m]> that gives me:
21:20mstenta[m]> `1 farm_map farm_map farm_theme 0 0 -1 0 0 -1`
21:20mstenta[m]referring to this^
21:21paul121[m]huh okay
21:21mstenta[m]i had you try setting the `region` column of that db record... but there are other aspects that need to be set too, like `status`, `visibility`, and `pages`
21:21mstenta[m]so i would want to figure out why that hook isn't firing...
21:22mstenta[m]if you have devel enabled, you could try putting a `dpm('test');` in the top of that function (`farm_theme_block_info_alter()`)
21:22mstenta[m]then clear the cache and see if that message appears
21:22mstenta[m]i don't think it will
21:23paul121[m]makes sense. I'll try that
21:24mstenta[m]i bet if you set those values manually in the `block` db table, the map will show up
21:24mstenta[m]the question is: why isn't that happening automatically?
21:26paul121[m]yeah, didn't seem to get a dpm message
21:26paul121[m]out of curiosity, have you installed a fresh farmOS:dev image lately?
21:36mstenta[m]No I haven't
21:36mstenta[m]But I'm running 7.x-1.x locally and on Farmier
21:37mstenta[m]It's still possible that there's a difference though
21:38paul121[m]hmm
21:39mstenta[m]Notably:
21:39mstenta[m]The dev image will not update the www folder if one already exists
21:39mstenta[m]So simply pulling a new image will not update you
21:40mstenta[m]But you said they are fresh installs...
21:40paul121[m]yeah, I pulled a new image yesterday before installing
21:40paul121[m]so one has the latest. the other is slightly older
21:44mstenta[m]Ok cool
21:44paul121[m]github.com/farmOS/farmOS/commit/e9b6caa1
21:44paul121[m]well that is JS so probably not it
21:45mstenta[m]Good hunch but yea that shouldn't affect it
21:45mstenta[m]Also: you don't have the map in HTML in the first place
21:45mstenta[m]It's definitely the block
21:45paul121[m]yeah. hmmmmm
21:46paul121[m]so in Drupal, you can define "blocks" which can then be used by the theme?
21:46paul121[m]to display how/where it wants?
21:46mstenta[m]> <@mstenta:matrix.org> | 110 | farm_map | farm_map | farm_theme | 1 | 0 | page_top | 0 | 1 | <front>
21:46mstenta[m]> farm/assets/* | | -1 |
21:46mstenta[m]This is what it should be
21:46mstenta[m]Yes
21:49mstenta[m](your block id will be different, but that's what the rest of the record should look like)
21:50mstenta[m]I will try a fresh dev install after the kids are asleep
21:51paul121[m]👍️ does seem to be quite weird

< 082020-04-09⋏10 >