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

2021-08-05
2021-08-07
TimeNickMessage
[14:19:10]<shane_aldrich[m]>I started playing with the UI for `genus`, `species`, and `microscope_photos` so I can export those and add them to `farm_shane_fungi`. But when I try to edit the field settings for `microscope_photos` I get this error: "An illegal choice has been detected. Please contact the site administrator." when I try to select unlimited for the number of values. Does this have something to do with the private file system?
[14:47:33]<paul121[m]>hmm. I know that some field settings can't be changed once you've create a field via the UI
[14:48:03]<paul121[m]>but I think you should be able to change the cardinality of the field after it has been created (at least expand from limited -> unlimited)
[14:48:15]<paul121[m]>(that is one of the exceptions)
[14:48:38]<paul121[m]>(for example you can't change the field ID since the db tables/columns are already created)
[14:48:56]<paul121[m]>you might need to delete the field & recreate if it isn't cooperating with you!
[14:58:40]<shane_aldrich[m]>This happened during the initial creation of the field. So I exported it and have it in phpstorm now. What should I change the cardinality to?
[15:00:04]<shane_aldrich[m]>Nevermind. I looked at the `plant_type` image field and saw it set as `-1`
[15:03:50]<shane_aldrich[m]>OK. So I've gone through the UI to create the following terms and fields: `genus`, `species`, `microscope_photos`, `raw_material`, and `supplement`
[15:03:51]<shane_aldrich[m]>I'll delete what I created through the UI and then install my module to test it out (after I take a shower).
[15:08:07]<paul121[m]>nice!
[15:56:35]<shane_aldrich[m]>So I'm getting "unmet dependencies" for `genus` and `species` when I try to install `farm_shane_fungi`. Can someone look at my `0.0.1` repo for advice?
[16:40:15]<paul121[m]>it looks like both `genus` and `species` depend on the `fugi_type` vocabulary (`taxonomy.vocabulary.fungi_type`)
[16:40:44]<paul121[m]>but I don't see a `taxonomy.vocabulary.fungi_type` in your config/install: https://github.com/s33a/farm_shane_fungi/tree/0.0.1/config/install
[16:41:23]<paul121[m]>might have forgotten to export that vocabulary?
[16:41:39]<mstenta[m]>https://git.drupalcode.org/project/farm_fungi/-/blob/2.x/config/install/...
[16:41:50]<mstenta[m]>that's provided by `farm_fungi` module
[16:42:26]<paul121[m]>ah yes
[16:44:55]<paul121[m]>I saw `shange_fungi_type` disappeared with the new version, but that makes sense!
[16:48:02]<paul121[m]>maybe this line? https://github.com/s33a/farm_shane_fungi/blob/555e717c8da64804a411fefa9c...
[16:48:14]<paul121[m]>should be `farm_fungi:farm_fungi` I think?
[16:48:51]<paul121[m]>(because `farm_fungi` is provided by the `farm_fungi` project, not the `farm` project)
[16:49:36]<paul121[m]>but maybe that's only a soft requirement and isn't really an issue?
[17:11:56]<shane_aldrich[m]>Just tried `farm_fungi:farm_fungi` in my `info.yml` file and it didn't work. I'll try to do the same with the `field` and `field.storage` files to see what happens.
[17:16:50]<paul121[m]>it probably just needs to be `farm_fungi` in those files if it is needed there
[17:18:08]<mstenta[m]>shane_aldrich were all these configs created in the drupal UI and exported to yml?
[17:18:25]<mstenta[m]>Or did you do anything manually in the yml
[17:19:22]<mstenta[m]>> yea always best to do it in the UI and then export... that way Drupal generates the YML so you can be sure it's all correct
[17:19:22]<mstenta[m]>^
[17:20:04]<mstenta[m]>(I'm not at my laptop so my ability to review is limited but taking a quick look now)
[17:22:57]<mstenta[m]>Are both the species and genus fields referencing other terms in the fungi type vocabulary?
[17:24:28]<shane_aldrich[m]>I had the issue from the get-go with the code provided by Drupal. So I added the `farm_fungi` dependency. After changing my `info.yml` file to `farm_fungi:farm_fungi` and removing `farm_fungi:` from ` the `genus` and `species` files, it installs without error. Now to see how things look.
[17:26:14]<mstenta[m]>I don't think the "unmet dependencies" is related to the .info.yml dependencies. Just the config dependencies
[17:26:46]<mstenta[m]>And yeah, in those you don't use the farm_fungi: prefix
[17:27:27]<shane_aldrich[m]>Everything has been pushed to my repo. You can see what I have there now. I think what paul121 mentions about `farm_fungi:farm_fungi` did the trick.
[17:27:28]<mstenta[m]>Which genus and species files are you referring to because there are two of each
[17:27:39]<shane_aldrich[m]>All of them
[17:27:56]<mstenta[m]>Oh it's working now?
[17:28:03]<paul121[m]>it's possible .info.yml issue prevented `farm_fungi` from being installed (that was my thought)
[17:28:33]<paul121[m]>well, not prevented, but didn't depend on it, so it was never installed
[17:29:23]<shane_aldrich[m]>it has been installed for the last few days while I played with the UI stuff.
[17:31:42]<shane_aldrich[m]>Aw crap! somehow I did an undo in phpstorm and it added my `shane_fungi_types` vocabulary back in. so it's showing up in farmOS. I'm just going to ignore that for now.
[17:32:50]<shane_aldrich[m]>just looked at Fungi types vocabulary and neither `genus` nor `species` show up in terms. Hmmm
[17:33:32]<mstenta[m]>One thing to note: if your module provides config in config/install it will NOT be uninstalled when you uninstall the module unless you declare it as an "enforced" dependency
[17:34:18]<mstenta[m]>For example: https://github.com/farmOS/farmOS/blob/b8b3d8c5d013ff63dbe7da456a8e2f7a9a...
[17:35:04]<mstenta[m]>So that is best practice... To ensure that you can uninstall a module (and all the config it provides) cleanly
[17:35:14]<shane_aldrich[m]>so I would need to add `farm_shane_fungi` to the enforced module section as well?
[17:35:16]<mstenta[m]>Yes
[17:35:48]<mstenta[m]>You will notice that if you try to uninstall and then reinstall without that it will error
[17:36:07]<mstenta[m]>Because the config doesn't get uninstalled so it will say it already exists when you try to install again
[17:36:19]<shane_aldrich[m]>OK. I guess I need to to a clean install of farmOS. Or... could I change those files and `drush cr` to see if that works?
[17:36:43]<mstenta[m]>Yea clean install might be easiest
[17:36:53]<mstenta[m]>Drush cr won't do it
[17:37:16]<mstenta[m]>You would need to make that change in yml and then revert them all with the config_update_ui module
[17:38:10]<mstenta[m]>(but once you add that stuff to yml and do a fresh install then it will be possible to uninstall+reinstall the module without a whole drupal reinstall)
[17:38:18]<shane_aldrich[m]>Cool. I need to do a couple of personal things for the next 30 minutes. When I get back to the computer, I'll edit the config files and get the fresh install going.
[17:43:34]<mstenta[m]>> just looked at Fungi types vocabulary and neither `genus` nor `species` show up in terms. Hmmm
[17:43:34]<mstenta[m]>I think I know why
[17:44:20]<mstenta[m]>Did you configure "Manage form display" and "Manage display" after you added those fields?
[17:44:41]<mstenta[m]>That is a separate config that needs to be exported (unfortunately IMO)
[17:49:55]<mstenta[m]>So the fields are probably there (tables in the database)
[17:50:01]<mstenta[m]>But they are hidden by default
[17:50:13]<mstenta[m]>Until you provide the config to show them
[17:52:03]<shane_aldrich[m]>When I go into "Manage form display" and "Manage display" they are "disabled". How do I fix that for the next install?
[17:52:39]<mstenta[m]>1. Configure how you want them to appear in both of those places
[17:52:53]<mstenta[m]>2. Export the config for both of those to your module
[17:53:33]<mstenta[m]>Off the top of my head they are called "entity form display" and "entity display" or something like that
[17:53:45]<mstenta[m]>(in the config export type drop-down)
[17:55:45]<shane_aldrich[m]>I exported the code from what I generated through the UI for all terms, fields, and field storage with only `farm_fungi` installed. Which is why I don't understand terms not showing up in the "Fungi types" vocabulary.
[17:56:44]<shane_aldrich[m]>The fields show up fine
[18:00:47]<mstenta[m]>Oh maybe I'm misunderstand
[18:00:55]<mstenta[m]>* Oh maybe I'm misunderstanding
[18:01:26]<shane_aldrich[m]>Fresh install happening now
[18:02:01]<mstenta[m]>What do you mean by "terms not showing up in the vocabulary"?
[18:07:11]<shane_aldrich[m]>I'll take a screenshot once I'm back up and running. Installing other modules now.
[18:18:26]<shane_aldrich[m]>There will be a series of screenshots starting with just `farm_fungi` enabled
[18:19:04]<shane_aldrich[m]>ACTION uploaded an image: (82KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/qQeApWXBCdf... >
[18:19:37]<shane_aldrich[m]>ACTION uploaded an image: (62KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/vIoYXJwMTXr... >
[18:19:55]<shane_aldrich[m]>Now I'll install `farm_shane_fungi`
[18:21:13]<shane_aldrich[m]>ACTION uploaded an image: (76KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/swvntdLdBTW... >
[18:21:48]<shane_aldrich[m]>ACTION uploaded an image: (77KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/rpfhdqVovLe... >
[18:22:13]<shane_aldrich[m]>ACTION uploaded an image: (154KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/TyDJjBXLKwn... >
[18:22:36]<shane_aldrich[m]>ACTION uploaded an image: (102KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/WCJdbcqnnNz... >
[18:22:45]<shane_aldrich[m]>That's it.
[18:23:26]<mstenta[m]>Cool! Looks like the fields installed properly as expected
[18:23:26]<mstenta[m]>Aside from being disabled
[18:23:41]<mstenta[m]>Which will be fixed once you export the form and display config
[18:26:03]<shane_aldrich[m]>But the terms still aren't showing up. Is that due to them being disabled? Also, I can't uninstall my module again. I did the enforced changes, but I probably didn't do it right.
[18:29:42]<shane_aldrich[m]>And I can't figure out how to export those files. I went to `admin/config/development/configuration/single/export` and don't see an option there for those particular files.
[18:31:20]<paul121[m]>"No terms available. Add term." shane_aldrich is that what you think the problem is? (just clarifying)
[18:32:30]<shane_aldrich[m]>Yeah. I have all of the yml config files in `config/install` but they just won't show up there.
[18:33:39]<paul121[m]>ah okay - I think it's just a misunderstanding!
[18:33:42]<paul121[m]>that isn't a problem!
[18:34:07]<paul121[m]>terms themselves are "content entities" - not config entities
[18:34:46]<paul121[m]>if you go to `admin/structure/taxonomy/manage/farm_fungi/add` you can add individual terms
[18:34:55]<paul121[m]>and the "No terms available" message will go away
[18:35:30]<paul121[m]>what you've done is configured the `genus` and `species` fields to be available on each term
[18:36:35]<shane_aldrich[m]>All of that code I used to generate the files came from me adding those terms to "Fungi types" and doing a single export.
[18:38:04]<shane_aldrich[m]>Maybe I'm not understanding "terms" properly here. Are you saying that in that space, it would actually be data that has been entered for `genus` and `species`?
[18:38:48]<paul121[m]>shane_aldrich[m]: "adding those *fields* to the fungi_type *vocabulary* and doing a single export" is more correct
[18:39:41]<paul121[m]>yea.. "terms" has a specify meaning in this context
[18:39:44]<paul121[m]> * yea.. "terms" has a specific meaning in this context
[18:40:02]<shane_aldrich[m]>I see what you mean by the code I generated.
[18:41:01]<paul121[m]><paul121[m]> "if you go to `admin/structure/ta" <- should be `admin/structure/taxonomy/manage/fungi_type/add` - my bad
[18:41:31]<paul121[m]>does that work? that page is where you create an individual "term" (a content entity, a row in the database)
[18:42:06]<paul121[m]>and on those terms you've made it possible to define a `genus` and `species` for that single term
[18:42:52]<paul121[m]> * and for the fungi_type you've made it possible to define a `genus` and `species` for individual terms
[18:43:29]<shane_aldrich[m]>So say I have a `fungi_type` (aka common name) of Reishi, and the `genus` is Gandoderma and the `species` is lucidum, those won't show up until entered into the database.
[18:44:47]<shane_aldrich[m]>Cool. That makes more sense! Now how can I export the "Manage form display" and "Manage display" for Fungi types?
[18:46:06]<paul121[m]>should be possible from the same page, export single item, "entity form display" and "entity view display" are the "configuration types"
[18:46:59]<paul121[m]>the "configuration name" should be `taxonomy_term.fungi_type.default`
[18:47:09]<shane_aldrich[m]>This is the only name I see "taxonomy_term.plant_type.default"
[18:47:58]<paul121[m]>mm okay. so you probably need to modify it first
[18:48:09]<paul121[m]>from your screenshots it didn't look like it was modified yet
[18:48:30]<shane_aldrich[m]>So just make a quick change and save?
[18:48:39]<paul121[m]>(drag the genus and species up out of the disabled part of the table)
[18:48:40]<paul121[m]>yep
[18:50:04]<mstenta[m]>(I'm having dinner with family but 👍👍 to what paul121 said 😊)
[18:50:43]<shane_aldrich[m]>don't talk to us while your having dinner with the fam! 🤣
[18:51:10]<paul121[m]>haha
[18:52:23]<shane_aldrich[m]>That worked like a charm! Now I can move on with that aspect and apply it to `substrate_type`
[18:52:23]<shane_aldrich[m]>But... I would like to know why I still can't uninstall my module. Help! 😜
[18:53:22]<paul121[m]>can't uninstall `farm_shane_fungi` ?
[18:53:30]<shane_aldrich[m]>yup
[18:53:40]<paul121[m]>did it give a reason?
[18:53:58]<shane_aldrich[m]>the checkbox is greyed out
[18:54:15]<mstenta[m]>https://github.com/s33a/farm_shane_fungi/blob/0722a54442d643ba77edc38f92...
[18:54:16]<mstenta[m]>Don't need that
[18:54:17]<mstenta[m]>Not sure if that's why
[18:55:45]<paul121[m]>it should say something like:
[18:55:45]<paul121[m]>> The following reason prevents Log from being uninstalled:
[18:55:45]<paul121[m]>- ...
[18:58:34]<shane_aldrich[m]>It was me just being stupid... I was trying to do it through "Extend List"
[18:58:51]<shane_aldrich[m]>Re-installing now
[18:59:35]<paul121[m]>ooh, yea, I often do the same
[19:01:00]<shane_aldrich[m]>Here's a new error: "Unable to install Shane Fungi, core.entity_form_display.taxonomy_term.fungi_type.default, core.entity_view_display.taxonomy_term.fungi_type.default already exist in active configuration."
[19:01:09]<shane_aldrich[m]>is that in the database?
[19:01:19]<paul121[m]>ahh this is what mike mentioned earlier
[19:02:00]<paul121[m]>can you go here? http://localhost/admin/config/development/configuration/report/type/syst...
[19:03:05]<paul121[m]>(need to install the Configuration Update Reports module if not)
[19:03:19]<shane_aldrich[m]>I
[19:03:27]<shane_aldrich[m]> * I'm there
[19:04:03]<paul121[m]>so search for those `fungi_type` configs on that page
[19:04:12]<paul121[m]>and delete them
[19:04:50]<paul121[m]>! only delete the `core.entity_form/view_display.taxonomy_term.fungi_type.default.yml` config
[19:05:27]<shane_aldrich[m]>on it
[19:06:15]<paul121[m]>I would guess they are in the "Added configuration items" group
[19:07:01]<shane_aldrich[m]>Worked! I just did Ctl+F to find "core" and those were the first two
[19:07:14]<paul121[m]>nice, and you were able to install?
[19:07:24]<shane_aldrich[m]>indeed!
[19:07:33]<paul121[m]>great!
[19:08:20]<shane_aldrich[m]>I'm going to sign off for the day. Thank you guys for all of your help!
[19:09:31]<paul121[m]>np!