< 262021-10-27⋎28 >

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

< 262021-10-27⋏28 >