Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag missing new blog item #2107

Closed
NandoPiz opened this issue Mar 31, 2021 · 9 comments
Closed

Tag missing new blog item #2107

NandoPiz opened this issue Mar 31, 2021 · 9 comments
Assignees

Comments

@NandoPiz
Copy link

HI, I have an issue with taxonomies tag with the admin plugin
The problem is that when I create a new blog item page under Taxonomies field I found the right Category (blog) but some tags are missing form drop-down menu. I mean that totally I have 6 tags defined but when I create a new blog item page on 4 are showed in the drop-down menu
If I create a new tag and add it apparently works (item.md contains the new tag) BUT this is missing again in the drop-down menu on the next blog item creation.
Any ideas?
Grav version 1.7.9
Admin Panel 1.10.8
Theme: Quark Open Publishing 2.2.7
I've done also a test with admin panel v1.9.19 and the issue is not present but start with 1.10.x version.
I've tried also a fresh installation of Open Publishing Space skeleton and the new tag works well. May be related to my environment and I’m not able to understand where is my issue. Are there some suggestion? regards

@NandoPiz
Copy link
Author

NandoPiz commented Apr 6, 2021

HI, I found the issue.
I’ve customized supported Languages. In the system configuration I’ve add “it” and “en”.
When I create a new blog Item a new folder is created. Inside this folder you can find item.it.md. I’ve understand that tag is visible (from drop down menu) only for item.md and not for all element item.en.md or item.it.md

@pamtbaau
Copy link

pamtbaau commented Apr 6, 2021

Reproducable test: When language support has been enabled, dropdown of Category field in Admin is not populated with existing categories.

Working example: No language support

  • Fresh Grav 1.7.9 + Admin installation
  • Open Admin
  • Goto to ‘/admin/pages’, click ‘Add’ page,
    • Name: ‘page1’, leave rest as is.
  • In ‘admin/pages/page1/:add’, add ‘cat1’ to field ‘Category’ and click ‘Save’
  • Go back to ‘/admin/pages’, click ‘Add’ page,
    • Name: 'page2', leave rest as is.
  • In ‘admin/pages/page2/:add’, click in field ‘Category’
    • Dropdown contains ‘cat1’
    • This works as expected.

Failing example: With languague support

  • Fresh Grav 1.7.9 + Admin installation
  • In ‘user/config/system.yaml’ add:
    languages:
      supported: [en, it]
    
  • Open Admin
  • Goto to ‘/en/admin/pages’, click ‘Add’ page,
    • Name: ‘page1’, leave rest as is.
  • In ‘/en/admin/pages/page1/:add’, add ‘cat1’ to field ‘Category’ and click ‘Save’
  • Go back to ‘/en/admin/pages’, click ‘Add’ page,
    • Name: 'page2, leave rest as is.
  • In ‘/en/admin/pages/page2/:add’, click in field ‘Category’.
    • Dropdown does not contain ‘cat1’
    • Does not work as expected.

@mahagr
Copy link
Member

mahagr commented Apr 23, 2021

Looks like taxonomies are picked up only from the files which do not have language suffix in them. So if you take the first example and then add language support, the tags in the previous files are being supported.

@mahagr mahagr self-assigned this Apr 23, 2021
@mahagr mahagr added the bug label Apr 23, 2021
@mahagr
Copy link
Member

mahagr commented Apr 23, 2021

I'm wondering how this should behave... Should we include taxonomies from the current language only, or should we include taxonomies from all the languages? I think it should be the current language only (faster and less confusing)..?

@NandoPiz
Copy link
Author

Until admin panel v1.9.19 and the issue is not present but start with 1.10.x version. I don't know how it works in previus version. In my opinion should be included al least what has benn configured in user/config/system.yam languages: supported: [en, it]

@pamtbaau
Copy link

pamtbaau commented Apr 23, 2021

Admin v1.9.13 (Grav 1.6.23) only shows taxonomies collected from pages with the current language.

Meaning:

  • When editing *.en.md, only tags collected from English pages are shown in dropdown
  • When editing *.it.md, only tags collected from Italian pages are shown in dropdown

That is also the behaviour I would expect to see.

@mahagr
Copy link
Member

mahagr commented Apr 23, 2021

OK, this one needed a bit more work than I thought. :) Both Grav and Admin updates are required to fix the issue.

Here is the link to the Grav changes: getgrav/grav@3e91be9

Basically, I had to add support for getting translated collections from Flex Pages, which should be a very useful feature in general.

@pamtbaau
Copy link

  • Cloned develop branch Grav
  • Cloned develop branch Admin
  • Set system.yaml: languages.supported: [de, it]
  • Added tags 'DE1', 'DE2' to German page
  • Added tags 'IT1', 'IT2' to Italian page
  • Create new Italian page -> tags 'IT1', 'IT2' are shown in dropdown
  • Create new German page -> tags 'DE1', 'DE2'are shown in dropdown

All seems to be going well...

@mahagr
Copy link
Member

mahagr commented Apr 23, 2021

Thanks for testing it. We are likely going to release it today.

@mahagr mahagr closed this as completed Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants