IRC logs for #farmOS, 2021-10-27 (GMT)

2021-10-26
2021-10-28
TimeNickMessage
[16:02:09]<shane_aldrich[m]>I just did some changes in the View UI for my module dashboard. Now I'm not seeing the changes after uninstalling and reinstalling the module. I went to `/admin/config/development/configuration/report/type/system.all` to see what was going on and the view shows up under "missing configuration items". Why would that happen?
[16:02:53]<mstenta[m]>shane_aldrich: did you export the Views config to YML in your module?
[16:03:10]<mstenta[m]>making changes to Views via the UI does not automatically change the YML config
[16:03:42]<mstenta[m]>you would need to export and commit those changes to your module for them to persist
[16:03:51]<shane_aldrich[m]>I did the export. Copied it to my file. Saved it. Then did the uninstall/reinstall.
[16:03:57]<mstenta[m]>oh ok
[16:03:59]<mstenta[m]>huh
[16:04:31]<shane_aldrich[m]>When I click on "import from source", it just takes me to my module dashboard page.
[16:04:39]<mstenta[m]>> the view shows up under "missing configuration items"
[16:04:39]<mstenta[m]>oh interesting...
[16:05:17]<mstenta[m]>you have it in `/config/install` right? not `config/optional`?
[16:05:37]<shane_aldrich[m]>Yeah. No `uuid` in my yml file. And it's in `config/install`
[16:05:39]<mstenta[m]>only thing i can think is that maybe there's something wrong with the YML
[16:05:53]<mstenta[m]>but if you exported straight from drupal then it should be ok
[16:06:11]<mstenta[m]>so... the View does not exist at all when you reinstalled your module?
[16:06:31]<mstenta[m]>it doesn't show under /admin/structure/views?
[16:06:33]<shane_aldrich[m]>Correct. It doesn't show up in the View UI
[16:06:37]<mstenta[m]>hmm
[16:06:47]<mstenta[m]>but it did before?
[16:06:58]<shane_aldrich[m]>It did until I uninstalled
[16:07:37]<mstenta[m]>is this the first time you've tried "installing the view from config"?
[16:07:44]<mstenta[m]>or was that part working before your recent changes?
[16:08:26]<shane_aldrich[m]>I did this a couple months ago and it worked. This time I just made some changes to only show `fungi` assets.
[16:08:31]<mstenta[m]>can you share your YML via pastebin.com perhaps?
[16:08:43]<mstenta[m]>ok, and did you commit that change?
[16:08:50]<shane_aldrich[m]>It's been pushed to my github repository
[16:08:56]<mstenta[m]>if so, you could try rolling back to a previous commit and see if it works
[16:09:06]<mstenta[m]>(to try to isolate the issue)
[16:09:16]<shane_aldrich[m]>Let me try that
[16:10:03]<shane_aldrich[m]>Should that be a git reset?
[16:10:17]<mstenta[m]>otherwise, i might suggest trying to rebuild a VERY simple version of that View from scratch, export it, commit it, uninstall+reinstall... try to get SOMETHING to work... and then use that working one to compare against the original config that isn't working to see if you can figure out what's different/wrong with your current config
[16:10:37]<mstenta[m]>you can do `git checkout [commit-sha]` to jump to a specific commit
[16:10:56]<mstenta[m]>(you won't be on any branch at that point, but you can jump back with `git checkout [branch]` after)
[16:11:03]<mstenta[m]>just make sure you don't have any pending changes!
[16:14:18]<shane_aldrich[m]>"unexpected error' when reinstalling the module
[16:14:26]<mstenta[m]>gul[p
[16:15:00]<shane_aldrich[m]>Maybe it has something to do with the `core.entity_form` yml file?
[16:15:41]<mstenta[m]>if you jump back to the branch you were on, are you able to install?
[16:15:45]<shane_aldrich[m]>I did a `drush cr` after uninstalling
[16:15:57]<mstenta[m]>(be sure to `drush pm-uninstall [module]` first to clean up_
[16:16:15]<mstenta[m]>> "unexpected error' when reinstalling the module
[16:16:16]<mstenta[m]>did this happen during uninstall? or install?
[16:16:22]<shane_aldrich[m]>Let me try that first
[16:16:24]<shane_aldrich[m]>Install
[16:17:39]<shane_aldrich[m]>Uninstalled via `drush`. Should I use the UI to try and install again?
[16:18:49]<mstenta[m]>may as well just stick to drush
[16:18:55]<mstenta[m]>`drush en [module]` to install
[16:19:25]<mstenta[m]>if you get an error you can try going to /admin/reports/dblog to see if there are any details
[16:20:09]<shane_aldrich[m]>In my command line I get "Missing required properties for an EntityDisplay entity."
[16:20:28]<mstenta[m]>oh ok
[16:20:43]<shane_aldrich[m]>Does that help?
[16:20:57]<mstenta[m]>hmm, i've never seen that before... but did you add fields to your entity earlier? and maybe those did not get saved to your module?
[16:21:06]<mstenta[m]>so they were lost on uninstall?
[16:21:31]<mstenta[m]>(just a guess)
[16:21:57]<shane_aldrich[m]>Not that I can think of. Like I mentioned... I just tried to restrict the view to "fungi" only.
[16:22:14]<mstenta[m]>ok
[16:22:40]<mstenta[m]>so the `core.entity*` config is totally separate/unrelated to `views*` config
[16:23:06]<mstenta[m]>you were able to install the module without this error before you did `git checkout [commit]`?
[16:23:23]<shane_aldrich[m]>yes
[16:23:32]<mstenta[m]>did anything else change between `[commit]` and `[branch]` other than the Views config?
[16:23:44]<shane_aldrich[m]>no
[16:23:49]<mstenta[m]>very strange
[16:24:11]<mstenta[m]>well... how about you try deleting the `core.entity*` config temporarily
[16:24:15]<mstenta[m]>and see if that allows you to install
[16:24:26]<mstenta[m]>(might be two different things happening at once here, causing confusion)
[16:24:36]<shane_aldrich[m]>Here are the two file names I have in `config/install`:
[16:24:36]<shane_aldrich[m]>`core.entity_view_display.taxonomy_term.fungi_type.default.yml`
[16:24:36]<shane_aldrich[m]>`core.entity_form_display.taxonomy_term.fungi_type.default.yml`
[16:24:51]<mstenta[m]>try deleting both of those
[16:24:58]<shane_aldrich[m]>OK
[16:25:03]<mstenta[m]>(assuming they are saved in git history you can get them back easily)
[16:25:42]<shane_aldrich[m]>uninstalling first
[16:27:27]<shane_aldrich[m]>Installed with `drush` and no errors. I'll use your suggestion to start with a simple view to start.
[16:28:19]<mstenta[m]>sounds good
[16:28:51]<mstenta[m]>maybe when you were on your main branch, the Views config installation failed, and then it didn't even try to install the `core.entity*` config....
[16:28:59]<mstenta[m]>(just trying to guess why you didn't see the same error)
[16:29:15]<mstenta[m]>definitely seems like 2 separate issues intersecting somehow - so yea... try to isolate :-)
[16:29:44]<mstenta[m]>oh or maybe the entity config caused the views config to fail!
[16:29:54]<shane_aldrich[m]>I've been using my `0.0.1` branch for everything. When I create this view from the UI, should I also create a page?
[16:30:01]<mstenta[m]>maybe checkout your main branch again, delete those two files and see if the view works now!
[16:30:10]<mstenta[m]>maybe it was just the `core.entity*` config that was breaking everything
[16:31:21]<shane_aldrich[m]>I've reverted the `core.entity*` config to before this happened.
[16:51:14]<shane_aldrich[m]>I made a real simple view that doesn't show anything at the moment (no fungi assets added yet). So I'm ready to do the export. How should I name the yml file?
[16:51:46]<mstenta[m]>go to the export page
[16:52:03]<mstenta[m]>and underneath the textarea with the YML to copy there is a filename
[16:52:24]<shane_aldrich[m]>Ha! How did I miss that? 🤣
[16:52:32]<mstenta[m]>it's pretty tiny :-)
[16:52:48]<shane_aldrich[m]>it is!
[16:55:57]<shane_aldrich[m]>Now that I have that done. No errors! 🎉
[16:55:57]<shane_aldrich[m]>What is the best way to add a form to my module for adding fungi assets? I want to try and accomplish this through my module's navigation before I move on.
[16:56:26]<mstenta[m]>woo hoo!
[16:56:39]<mstenta[m]>oh! make a quick form!!!
[16:56:59]<mstenta[m]>paul121 and i literally just merged the `2.x-quick` branch which adds support for this
[16:57:09]<mstenta[m]>i have to run though - 5 oclock here
[16:57:10]<paul121[m]>hot off the press :-)
[16:57:28]<mstenta[m]>i'm releasing 2.0.0-alpha5 RIGHT NOW
[16:57:31]<mstenta[m]>which includes it :-)
[16:57:40]<mstenta[m]>so you can update to that shortly...
[16:57:40]<shane_aldrich[m]>So I should do a fresh farmOS install then? ;)
[16:57:51]<mstenta[m]>wait for alpha5... couple minutes ;-)
[16:58:22]<shane_aldrich[m]>OK. Stepping out for a smoke. I'll be back!
[16:59:13]<mstenta[m]>https://twitter.com/farmOSorg/status/1453466308792684545
[17:03:48]<shane_aldrich[m]>How should I update?
[17:04:07]<shane_aldrich[m]>drush?
[17:05:49]<shane_aldrich[m]>Does this method still apply? https://farmos.org/hosting/updating/
[17:22:03]<mstenta[m]>No that's for farmOS 1.x
[17:22:44]<mstenta[m]>You're not using Docker, correct?
[17:23:12]<mstenta[m]>The GitHub release for alpha5 has a tarball
[17:24:23]<mstenta[m]>That includes the fully built farmOS codebase
[17:25:04]<mstenta[m]>I'm assuming you're running a version older than alpha4... So you will probably need to install from scratch
[17:26:22]<shane_aldrich[m]>No Docker. I'm going through my usual procedure right now.
[17:27:11]<mstenta[m]>https://github.com/farmOS/farmOS/releases/tag/2.0.0-alpha5
[17:27:28]<mstenta[m]>The tarball is available there
[17:27:38]<shane_aldrich[m]>Already downloaded and uncompressed. :)
[17:54:39]<shane_aldrich[m]>Alpha 5 up and running. I'll play around with the quick form for fungi assets before I have to take off. Meeting up with a friend in Oakland who is giving me a DJI Phantom 4 drone.
[17:55:55]<shane_aldrich[m]>Where do I find quick forms?
[18:05:01]<paul121[m]>quick form docs are here: https://docs.farmos.org/development/module/quick/
[18:05:18]<paul121[m]>just noticed, it looks like they didn't an entry in the menu...
[18:05:29]<paul121[m]>https://github.com/farmOS/farmOS/runs/4027448205?check_suite_focus=true#...
[18:06:26]<shane_aldrich[m]>I couldn't find it anywhere. I'll check out your links now.
[18:08:41]<shane_aldrich[m]>So it looks like this will be a better solution for my module instead of using PHP controller files.
[18:09:31]<shane_aldrich[m]>Is there a way to accomplish this through the UI? If so, what would be the URL?
[18:11:38]<paul121[m]>Yea, it's almost the same thing as the PHP controller files, but saves you a couple of the steps
[18:11:57]<paul121[m]>You still need to create the form in a PHP file
[18:13:36]<shane_aldrich[m]>OK. I'll need to look over the examples and see what I can come up with. Right now, I just want to have the ability to add new fungi strains directly from my module under the `purchasing/genetics` tab
[18:22:13]<paul121[m]>okay. yeah I'd start with the quick form
[18:22:31]<paul121[m]>is the `purchasing/genetics` tab something you added to the menu?
[18:24:58]<shane_aldrich[m]>I've got a bunch of tabs. You can install the module to see them.
[18:26:33]<shane_aldrich[m]>Where are `phpcs` and `phpcbf` located now?
[18:28:44]<paul121[m]>neat
[18:28:50]<paul121[m]>I believe they are in `vendor/bin`
[18:29:16]<shane_aldrich[m]>not there in alpha 5
[18:30:07]<paul121[m]>hmm you know I don't think they would be included in our production release since they are development tools
[18:30:45]<shane_aldrich[m]>cool. I can point them to my other installation in PhpStorm. That will happen tomorrow.
[18:31:48]<paul121[m]>you have composer?
[18:31:49]<paul121[m]>> composer require squizlabs/php_codesniffer
[18:31:54]<shane_aldrich[m]>I do
[18:32:12]<paul121[m]>that might get both of them for ya
[18:32:33]<paul121[m]>but.... in our development docker image we do a couple other things to set them up... so not sure if that will out of the box for ya
[18:33:09]<shane_aldrich[m]>that's cool. I have them in my `/usr/bin`
[18:36:25]<shane_aldrich[m]>Last thing before I need to leave. I'm getting the following error with codesniffer: `Referenced sniff "Drupal" does not exist`
[18:36:42]<shane_aldrich[m]>I can't remember how to rectify that
[18:40:44]<paul121[m]>ah that's what I was referring to :-)
[18:41:23]<paul121[m]>we configure phpcs right here: https://github.com/farmOS/farmOS/blob/daa75281cd878dc91fb23d8931db07cd10...
[18:41:59]<paul121[m]>you might just need to do this: `vendor/bin/phpcs --config-set installed_paths /var/farmOS/vendor/drupal/coder/coder_sniffer`