Should I make a module gterm like gnode?
Or should I make a new contentEnabler plugin in the group module?
--------------

how to use:

1. apply the dependence. 2797793-20.patch
Configurable entities as group content -> https://www.drupal.org/project/group/issues/2797793
2. Apply the gvocab patch.
3. Install the group vocabulary plugin.
4. Add a user to the group.
5. Relate vocabulary to group.
6. Go the ` /admin/structure/taxonomy` view own vocabulary.

CommentFileSizeAuthor
#81 2810131-gterm-81-79-interdiff.txt1.85 KBmbovan
#81 2810131-gterm-81.patch29.38 KBmbovan
#79 2810131-gterm-79-76-interdiff.txt4.7 KBmbovan
#79 2810131-gterm-79.patch28.9 KBmbovan
#76 2810131-gterm-76-75-interdiff.txt13.77 KBmbovan
#76 2810131-gterm-76.patch25.88 KBmbovan
#75 2810131-gterm-75-72-interdiff.txt2.12 KBmbovan
#75 2810131-gterm-75.patch31.31 KBmbovan
#72 gterm-update.patch31.51 KBamerie
#49 2810131-46-49.txt2.11 KBdravenk
#49 2810131-49.patch10.06 KBdravenk
#47 2810131-47.patch10.03 KBdravenk
#46 2810131-46.patch10.21 KBdravenk
#46 interdiff-44-46.txt5.56 KBdravenk
#44 gvocab-2810131-44.patch8.58 KBdravenk
#44 interdiff-2810131-41-44.txt1.23 KBdravenk
#43 gvocab-2810131-43.patch20.79 KBdravenk
#43 interdiff-2810131-41-43.txt1.23 KBdravenk
#41 interdiff-2810131-34-41.txt7.62 KBdravenk
#41 gvocab-2810131-41.patch8.5 KBdravenk
#34 gvocab-2810131-34.patch7.73 KBdravenk
#34 interdiff-2810131-26-34.txt767 bytesdravenk
#22 group-2810131-22.patch41.95 KBdravenk
#22 group-2810131-22.diff.txt18.15 KBdravenk
#13 group-2810131-13.patch44.46 KBdravenk
#11 group-2810131-11.patch23.78 KBloicLEMEUT
#9 group-2810131-9.patch21.33 KBloicLEMEUT
#5 group-2810131-5.patch22.77 KBkristiaanvandeneynde
#3 gterm.patch22.64 KBmatslats
#2 gterm.diff22.64 KBmatslats
#26 gvocab-2810131-26.patch7.76 KBdravenk
#23 interdiff.txt18.15 KBdravenk
#23 group-2810131-22.patch41.95 KBdravenk
#53 interdiff-49-53.txt14.65 KBdravenk
#53 2810131-53.patch17.31 KBdravenk
#55 interdiff-53-55.txt3.36 KBdravenk
#55 2810131-55.patch16.15 KBdravenk
#67 2810131-67.patch16.3 KBalan_blake
#67 interdiff-55-67.txt802 bytesalan_blake
#68 2810131-68.patch16.23 KBdravenk
#68 interdiff-67-68.txt1.68 KBdravenk

Comments

matslats created an issue. See original summary.

matslats’s picture

StatusFileSize
new22.64 KB

This patch provides a gterm module, similar to the gnode module

matslats’s picture

StatusFileSize
new22.64 KB

changed the file extension of the patch in hope of getting it tested

zerolab’s picture

Status: Active » Needs review
kristiaanvandeneynde’s picture

Status: Needs review » Needs work
StatusFileSize
new22.77 KB

I cleaned up the patch a bit in order to better understand it. It seems like this could be a nice addition, but it bypasses a lot of the forms Group provides for you. The permissions seem pretty limited as well, for instance there is nothing controlling the relationship entity (GroupContent).

Could you elaborate further what you're trying to achieve and explain (with screenshots?) what each screen/form is responsible for?

P.S.: Did not review GroupOverviewTerms as it's a bit massive :(

nicholas.alipaz’s picture

Category: Task » Feature request

Was curious about this for a site I am working on, seems more like a feature request than a task. I would like to see this feature in the future.

skyredwang’s picture

Is this feature similar/alternative to OG Vocabulary?

maxilein’s picture

Could you please explain the intended scope of gterm.

loicLEMEUT’s picture

StatusFileSize
new21.33 KB

Hi all,

I have some error when i try to access to '/group/{group}/vocabulary/{taxonomy_vocabulary}/add', i will change this URL because the previous URL cause an error.

We have an another error in the submit handler form in .module.

Here is my patch.

Loïc

loicLEMEUT’s picture

Hi all,

I currently correct 2 bugs:

  • Permission of edit, delete
  • The table who list terms contains all terms, not only for groups.

I will give my patch just after I resolve that.

Loïc

loicLEMEUT’s picture

StatusFileSize
new23.78 KB

Hi all,

Here is my patch when I resolve bugs of permissions et item rendered in vocabulary list.

Hum, for the vocabulary list page, I think we have to make a views like gnode module ?

Loïc

dravenk’s picture

Assigned: Unassigned » dravenk

I add taxonomy term, then I have some error when i try to access to
`/admin/structure/views/view/group_nodes`
`/admin/structure/views/view/group_members`

error report:
```
Error: Call to a member function label() on null in Drupal\gterm\Plugin\GroupContentEnabler\GroupTerm->getPermissions() (line 64 of modules/custom/gterm/src/Plugin/GroupContentEnabler/GroupTerm.php).
……

```

dravenk’s picture

Status: Needs work » Needs review
StatusFileSize
new44.46 KB

I am on the basis of group-2810131-11.patch, added views like Gnode

dravenk’s picture

Assigned: dravenk » Unassigned
skyredwang’s picture

Status: Needs review » Needs work

Installing #14 patch, go to /group/*/terms, the error below is thrown:

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">RuntimeException</em>: Callable &quot;Drupal\gterm\Access\GroupTermAdminAccessCheck::access&quot; requires a value for the &quot;$taxonomy_vocabulary&quot; argument. in <em class="placeholder">Drupal\Component\Utility\ArgumentsResolver-&gt;handleUnresolvedArgument()</em> (line <em class="placeholder">142</em> of <em class="placeholder">core/lib/Drupal/Component/Utility/ArgumentsResolver.php</em>). <pre class="backtrace">Drupal\Component\Utility\ArgumentsResolver-&gt;getArgument(Object) (Line: 54)
Drupal\Component\Utility\ArgumentsResolver-&gt;getArguments(Array) (Line: 157)
Drupal\Core\Access\AccessManager-&gt;performCheck(&#039;access_check.gterm.admin&#039;, Object) (Line: 135)
Drupal\Core\Access\AccessManager-&gt;check(Object, Object, NULL, 1) (Line: 92)
Drupal\Core\Access\AccessManager-&gt;checkNamedRoute(&#039;entity.taxonomy_term.group_add_form&#039;, Array, Object, 1) (Line: 184)
Drupal\Core\Menu\LocalActionManager-&gt;getActionsForRoute(&#039;view.group_terms.page_1&#039;) (Line: 80)
Drupal\Core\Menu\Plugin\Block\LocalActionsBlock-&gt;build() (Line: 203)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func(&#039;Drupal\block\BlockViewBuilder::preRender&#039;, Array) (Line: 376)
Drupal\Core\Render\Renderer-&gt;doRender(Array) (Line: 448)
Drupal\Core\Render\Renderer-&gt;doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer-&gt;render(Array) (Line: 490)
Drupal\Core\Template\TwigExtension-&gt;escapeFilter(Object, Array, &#039;html&#039;, NULL, 1) (Line: 104)
__TwigTemplate_e436107d8014a72a4269492c73cb4b259c88bc54c03736a1686a5d35d1b2557d-&gt;doDisplay(Array, Array) (Line: 432)
Twig_Template-&gt;displayWithErrorHandling(Array, Array) (Line: 403)
Twig_Template-&gt;display(Array) (Line: 411)
Twig_Template-&gt;render(Array) (Line: 64)
twig_render_template(&#039;core/themes/bartik/templates/page.html.twig&#039;, Array) (Line: 384)
Drupal\Core\Theme\ThemeManager-&gt;render(&#039;page&#039;, Array) (Line: 435)
Drupal\Core\Render\Renderer-&gt;doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer-&gt;render(Array) (Line: 490)
Drupal\Core\Template\TwigExtension-&gt;escapeFilter(Object, Array, &#039;html&#039;, NULL, 1) (Line: 90)
__TwigTemplate_be8c7bbb9c824f2826368d7c8da984c6279779db72a67fd8056a00bb23b816f2-&gt;doDisplay(Array, Array) (Line: 432)
Twig_Template-&gt;displayWithErrorHandling(Array, Array) (Line: 403)
Twig_Template-&gt;display(Array) (Line: 411)
Twig_Template-&gt;render(Array) (Line: 64)
twig_render_template(&#039;core/themes/classy/templates/layout/html.html.twig&#039;, Array) (Line: 384)
Drupal\Core\Theme\ThemeManager-&gt;render(&#039;html&#039;, Array) (Line: 435)
Drupal\Core\Render\Renderer-&gt;doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer-&gt;render(Array) (Line: 147)
Drupal\Core\Render\MainContent\HtmlRenderer-&gt;Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 148)
Drupal\Core\Render\MainContent\HtmlRenderer-&gt;renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber-&gt;onViewRenderArray(Object, &#039;kernel.view&#039;, Object) (Line: 108)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher-&gt;dispatch(&#039;kernel.view&#039;, Object) (Line: 158)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>

This was tested on Core 8.4.0-dev with PHP 7.1.7

kaizerking’s picture

IMHO Many hosting services are not providing Php 7. I suggest to do development work on 5.6. I have seen modules developed on php 7 as base throw errors on 5.6. php 7 errors should be rectified on case to case basis

loicLEMEUT’s picture

Hi,

@skyredwang, same problem with Drupal 8.3.5 & PHP 7.1.

Perfect way we will have:
- First views have to list vocabulary who can access the user of group
- Second views have to list all terms in a views. It must have a button for add terms, and operations buttons like gnode.

Itis possible to list vocabularies to a views ?
https://www.drupal.org/node/2654684

Loïc

dravenk’s picture

Assigned: Unassigned » dravenk

I'm sorry I did not do enough to check.
I fix the above problem on next patch.

dravenk’s picture

Assigned: dravenk » Unassigned
loicLEMEUT’s picture

@dravenk Need help ?

dravenk’s picture

@loicLEMEUT
yes . I don't know why the action I added didn't show up.

dravenk’s picture

Status: Needs work » Needs review
StatusFileSize
new41.95 KB
new18.15 KB

Add gterm views

dravenk’s picture

StatusFileSize
new18.15 KB
new41.95 KB
loicLEMEUT’s picture

This patch works fine, but I have some erreur 502 Bad gateway during clear cache or install/uninstall this modules.

No errors in watchdog.

Else everything is ok for me.

dravenk’s picture

@loicLEMEUT

Maybe you can try this module
#2900635: Group Vocabulary

dravenk’s picture

StatusFileSize
new7.76 KB

In this patch, gvocab-2810131-26.patch Provide further about:
1. The group vocabulary offer by the taxonomy.
2. Offer permissions to edit of vocabulary.
3. Include the group_term feature what can be edit every term.
4. Different from group_term , You don't need to install every vocabulary in the configure avaliable content page.
5. Less the code. More then complete feature.

how to use:
1. Apply the gvocab patch.
2. Install the group vocabulary plugin.
3. Add a user to the group.
4. Relate vocabulary to group.
5. Go the ` /admin/structure/taxonomy` view own vocabulary.

Because the group vocabulary save the entity_id same with taxonomy vocabulary mechine name. So, you must apply that patch #2797793: Entities identified by strings as group content . That patch will alter the `group_content_field_data` table to change entity_id to VARCHAR(32).

dravenk’s picture

Need reviews, Thanks

maaty388’s picture

Status: Needs review » Needs work

Patch #26 is not working for me
site-name is unable to handle this request

dravenk’s picture

@matjaz_zavski
Could you tell me how you do that?Because I not see your error message or anything.I'm difficult to do it better.

maaty388’s picture

Steps to reproduce
Download group 8.x-1.x-dev
Download and apply your patch
Create new group type
Install gvocab plugin to group
Create new group
Go to related entities of your group
Relate existing entity to group
Group vocabulary
For content, you can choose default Tags
After saving I get error unable to handle request

dravenk’s picture

@matjaz_zavski
Thanks. but, you forget apply the another patch. I was write down into #26

Because the group vocabulary save the entity_id same with taxonomy vocabulary mechine name. So, you must apply that patch #2797793: Configurable entities as group content .

maaty388’s picture

Status: Needs work » Reviewed & tested by the community

Ahh... Sorry, that was the problem.
Now, this patch works without problems.
Thank you

dravenk’s picture

dravenk’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new7.73 KB
new767 bytes

The plugin name is too long. If the group bundle name also too long, then the database tables could not store the right name.So I rename the plugin id to a short name.

dravenk’s picture

maaty388’s picture

Can you upload git diff between this 2 patches, please?

dravenk’s picture

@matjaz_zavski
I had removed the patch #26 above.Then I 'm create the another patch . I believe the #34 completely different #26.

dravenk’s picture

Status: Needs review » Reviewed & tested by the community
dravenk’s picture

Status: Reviewed & tested by the community » Needs review

Need more reviews.

maxilein’s picture

I would be willing to test, but I don't know what I should test.

Maybe someone could specify the scope and features of this issue - #26 helps, but I would need a little more details ...

dravenk’s picture

StatusFileSize
new8.5 KB
new7.62 KB

Do three thing in this commit.
1. Make vocabulary api level conform the permission of group content.
2. Remove one property which not use.
3. Clean code to make it conform to code specifications.

dravenk’s picture

  1. +++ b/modules/gvocab/gvocab.module
    @@ -0,0 +1,112 @@
    +    $vocabulary_id = db_select('taxonomy_term_data', 't')
    

    db_select() note better ways in 9.0

  2. +++ b/modules/gvocab/gvocab.module
    @@ -0,0 +1,112 @@
    +    $group_vacab = $group_content->toArray();
    +    $gvid = $group_vacab['entity_id'][0]['target_id'];
    

    Change to `$gvid = $group_content->getConfigTarget();`

  3. +++ b/modules/gvocab/gvocab.module
    @@ -0,0 +1,112 @@
    + * @return \Drupal\Core\Access\AccessResultAllowed
    ...
    +function gvocab_entity_access(EntityInterface $entity) {
    +  if ($entity->getEntityTypeId() == 'taxonomy_vocabulary' && gvocab_access('', $entity->getConfigTarget())) {
    +    return AccessResult::allowed();
    +  }
    +}
    

    Change the code comment to `@return \Drupal\Core\Access\AccessResultAllowed|\Drupal\Core\Access\AccessResultNeutral`
    Should return the default `return AccessResult::neutral();`

Need more work to use the right ways.

dravenk’s picture

StatusFileSize
new1.23 KB
new20.79 KB
dravenk’s picture

StatusFileSize
new1.23 KB
new8.58 KB
lawxen’s picture

@dravenk
I view the code,
The patch have bug:
If a user just have a permission Edit terms in Tags(or some other vocabulary)
The patch will prevent the user edit the Tags.

dravenk’s picture

StatusFileSize
new5.56 KB
new10.21 KB

@caseylau
Thanks for review.

Fix:
Users lose their system permissions that can change the vocabulary terms.

dravenk’s picture

StatusFileSize
new10.03 KB

A little bit clean.

lawxen’s picture

@dravenk Great work!
can you uplaod the interdiff to help me find the difference

dravenk’s picture

StatusFileSize
new2.11 KB
new10.06 KB

@caseylau
Thank you for reminding me.

lawxen’s picture

After apply the patch, group type's edit permission link get error.

The website encountered an unexpected error. Please try again later.
Error: Call to a member function __toString() on string in Drupal\group\Access\GroupPermissionHandler->getPermissionsByGroupType() (line 147 of modules/contrib/group/src/Access/GroupPermissionHandler.php).
Drupal\group\Access\GroupPermissionHandler->getPermissionsByGroupType(Object) (Line: 105)
Drupal\group\Form\GroupPermissionsForm->getPermissions() (Line: 172)
Drupal\group\Form\GroupPermissionsForm->buildForm(Array, Object) (Line: 112)
Drupal\group\Form\GroupPermissionsTypeSpecificForm->buildForm(Array, Object, Object)
call_user_func_array(Array, Array) (Line: 514)
Drupal\Core\Form\FormBuilder->retrieveForm('group_admin_permissions', Object) (Line: 271)
Drupal\Core\Form\FormBuilder->buildForm('group_admin_permissions', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 576)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 153)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 38)
Drupal\jsonapi\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
dravenk’s picture

@caseylau
Thanks for post bug report

Applied into this git commit:
Author: jhedstrom
Date: Fri Oct 20 13:50:51 2017 +0200

Issue #2908830 by jhedstrom, mgalalm, dravenk: Crash when clicking "delete" any group content

goto /admin/group/types/manage/{group type}/permissions is fine.

but , after update group into follow commit. the output is broken.
see git log:

commit 517b55739044413982eaefec88ce2db867619814 (HEAD -> 8.x-1.x)
Author: Kristiaan Van den Eynde <magentix@gmail.com>
Date:   Wed Nov 22 15:16:57 2017 +0100

    Issue #2702735 by kristiaanvandeneynde: UX - Group node: Clean up permission names

Related issue:
#2702735: UX - Group node: Clean up permission names

dravenk’s picture

The problem #50 not from this patch. Fix suggestions move to https://www.drupal.org/project/group/issues/2928190 .

dravenk’s picture

StatusFileSize
new14.65 KB
new17.31 KB

Changes:
1. Create class GroupVocabularyAccessCheck.
2. Override entity reference autocomplete if user is group membership.

Status: Needs review » Needs work

The last submitted patch, 53: 2810131-53.patch, failed testing. View results

dravenk’s picture

Status: Needs work » Needs review
StatusFileSize
new3.36 KB
new16.15 KB

Change:
Update GroupTermAutocompleteMatcher make it filter the terms by right way.

alexd73’s picture

I have this error

The website encountered an unexpected error. Please try again later.
Error: Call to a member function label() on null in Drupal\group\Plugin\GroupContentEnablerBase->getContentLabel() (line 148 of modules/contrib/group/src/Plugin/GroupContentEnablerBase.php).

Drupal\group\Plugin\GroupContentEnablerBase->getContentLabel(Object) (Line: 127)
Drupal\group\Entity\GroupContent->label() (Line: 142)
template_preprocess_group_content(Array, 'group_content', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('group_content', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 576)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 108)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
dravenk’s picture

@alexd73
Thanks for reviews. but, can you reproduce with simplytest.me?
See:
#52

dravenk’s picture

Maybe #57 is wrong.
you miss a dependence possible. I writed down in #26

dravenk’s picture

Issue summary: View changes
dravenk’s picture

Issue summary: View changes
alexd73’s picture

dravenk’s picture

alexd73’s picture

Status: Needs review » Active

Oh! now I have this error:
Drupal\Core\Entity\EntityStorageException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'for_information' for column 'entity_id' at row 1: INSERT INTO {group_content_field_data} (id, type, langcode, gid, entity_id, label, uid, created, changed, default_langcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 22 [:db_insert_placeholder_1] => department-group_vocabulary [:db_insert_placeholder_2] => ru [:db_insert_placeholder_3] => 4 [:db_insert_placeholder_4] => for_information [:db_insert_placeholder_5] => Разделы для информации [:db_insert_placeholder_6] => 1 [:db_insert_placeholder_7] => 1513344159 [:db_insert_placeholder_8] => 1513344159 [:db_insert_placeholder_9] => 1 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 805 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

I use these patches:

"patches": {
      "drupal/group": {
        "Crash when clicking delete any group content": "https://www.drupal.org/files/issues/2908830-04.patch",
        "Configurable entities as group content": "https://www.drupal.org/files/issues/2797793-20.patch",
        "taxonomy enabler": "https://www.drupal.org/files/issues/2810131-55.patch"
      },
      "drupal/groupmenu": {
        "Urls without route in admin menu cause fatal error": "https://www.drupal.org/files/issues/non-routed-urls-in-admin-menu-2927842.patch"
      }
}
    

Maybe I must use something else?

dravenk’s picture

@alexd73
no, I think your database tables is broken after you apply the patch #61 which you said. Are you try to rerolled database before #63 ?

dravenk’s picture

dureaghin’s picture

Hi @alexd73. Did you tried to run "/update.php" ?

Thanks,
Alex.

alan_blake’s picture

StatusFileSize
new16.3 KB
new802 bytes

fix group user cannot change weight on overview page on core 8.5

dravenk’s picture

Status: Active » Needs review
StatusFileSize
new1.68 KB
new16.23 KB

Unable to apply.

2810131-67_0.patch:102: trailing whitespace.
  
2810131-67_0.patch:103: trailing whitespace.
  if (($entity_type == 'taxonomy_vocabulary' 
2810131-67_0.patch:104: trailing whitespace.
  && GroupVocabularyAccessCheck::checkCreatorAccess('', $entity->getConfigTarget()))||($entity_type == 'taxonomy_term') 
warning: 3 lines add whitespace errors.
+++ b/modules/gvocab/gvocab.module
@@ -76,8 +76,11 @@
+  $entity_type = $entity->getEntityTypeId();

If this is an entity type id, it should be $entity_type_id.

+++ b/modules/gvocab/gvocab.module
@@ -76,8 +76,11 @@
+  && GroupVocabularyAccessCheck::checkCreatorAccess('', $entity->getVocabularyId())) {

I don't think this condition is necessary and this method getVocabularyId() will be removed before 9.0.0.

Check the code standards. Change the status to Need review. :)

JulienD’s picture

Hi @dravenk

Could you tell us if the how to is still accurate?

Thanks

kyuubi’s picture

I would be interesting in this functionality.
Is there a chance this will get committed?
Cheers

carolpettirossi’s picture

Hi kristiaanvandeneynde,

Are you interested in add this module to the group module or do you think it's better to have a separated module as groupmenu, for example?

Thanks,
Carol

amerie’s picture

StatusFileSize
new31.51 KB

It looks like the newer patches with gvocab are providing different functionality than the original gterm. In our case, we don't want to associate entire vocabularies with groups, but individual terms in a single vocabulary. For anyone who needs that functionality, I updated the original gterm solution from comment #23 to be more like the gnode module and fix some bugs we ran into, etc.

Status: Needs review » Needs work

The last submitted patch, 72: gterm-update.patch, failed testing. View results

sajosh’s picture

Hi, I'd like to use gvocab.

Do I use the most current patch only, #72?

Or do i start from the beginning, #2, and apply all thirty some patches, one by one?

What do I do about the txt files?

mbovan’s picture

Title: taxonomy enabler » Taxonomy enabler
Status: Needs work » Needs review
StatusFileSize
new31.31 KB
new2.12 KB

I'm not exactly sure in which direction this issue is going, but I am interested in allowing Terms entities as group entities (without vocabularies).

I made the following changes based on #72:

  • Removed .DS files
  • Fixed the operation links in order to have "Create {Vocabulary}" menu link.
  • Fixed GroupTerm deriver definition which breaks Permissions page.
mbovan’s picture

StatusFileSize
new25.88 KB
new13.77 KB

I had to rewrite the patch from #75 as it had security flaws (allowing create access to vocabularies that are not enabled).

The patch now uses significantly less code and it relies upon Group base functionality.

carolpettirossi’s picture

Hi @mbovan there is a separate module to the taxonomy enabler here: https://www.drupal.org/project/group_taxonomy

Maybe you should consider using it and then the maintainer of this module could close this issue since there isn't a plan to merge this patch anytime soon?

mbovan’s picture

Hi @carolpettirossi

Thank you for pointing to Group Taxonomy module. I wasn't aware of it.

However, I tested it briefly and noticed it's different in functionality than other group modules (gnode, patched gmedia module).

The main differences between group_taxonomy and #76 (gterm) are:

  • The group_taxonomy module applies to vocabularies as group content. GTerm uses terms as group content.
  • group_taxonomy relies on global edit/update/delete vocabulary permissions. I don't see if it is possible to have 2 vocabularies enabled for 2 different groups without sharing the terms inside these vocabularies. As a result of that, there is no support for create operation inside a specific group? As Gterm relies on terms as group content, this is possible.

That being said, I think it still makes sense to keep this issue open (#76) in case there are other people who want to have taxonomy terms integration with groups in a way gnode, gmedia do it.

mbovan’s picture

StatusFileSize
new28.9 KB
new4.7 KB

More improvements to patch #76:

  • Implemented support for group tokens with terms.
  • Fixed type casting in gterm_taxonomy_vocabulary_insert.
  • Added bypass node access permission in the createEntityAccess().
berdir’s picture

+++ b/modules/gterm/src/Plugin/GroupContentEnabler/GroupTerm.php
@@ -40,7 +42,7 @@ class GroupTerm extends GroupContentEnablerBase {
     $operations = [];
 
-    if ($group->hasPermission("create $plugin_id entity", $account)) {
+    if ($group->hasPermission("create $plugin_id entity", $account) || $account->hasPermission('bypass node access')) {
       $route_params = ['group' => $group->id(), 'plugin_id' => $plugin_id];

I don't think that's correct. this permission is only for nodes, not for any other entity type.

mbovan’s picture

StatusFileSize
new29.38 KB
new1.85 KB

Right, there is no similar bypass node access for taxonomy terms, so I wasn't sure what would make sense here.

Instead, I added a new create any group term entity global permission. This allows sites to easily enable this permission for super editors who should not have any group permission restrictions.

mbovan’s picture

Status: Needs review » Closed (won't fix)

As per Slack conversation the idea of the maintainer is to have common core entity types supported out of the box by Group module (Node, User etc). For other entity types, the recommendation is to create a separate contrib module to make future maintenance easier.

Based on that, I created Group Term module which is in a nutshell #81 with a very few changes (namespace, permission name).

I gave credit to everybody who contributed to this issue (thank you!):

Issue #2810131 by dravenk, mbovan, loicLEMEUT, matslats, alan_blake, Amerie, kristiaanvandeneynde, maaty388, alexd73, lawxen, carolpettirossi, skyredwang, maxilein, zerolab, Berdir: Taxonomy enabler

Let me know if you think you're missing from the list and deserve credit.

To summarize, since we now have two contrib modules:

  • Group Term that makes Taxonomy term entities group content
  • Group Taxonomy that makes Taxonomy vocabulary entities group content

I think it's safe to assume that we have all cases covered.

I'll close this issue as won't fix and we can continue discussions in the issue queues of these two modules.

mbovan’s picture

Status: Closed (won't fix) » Fixed

Reading through https://www.drupal.org/issue-queue/status#fixed: "The issue has been resolved (usually by committing a patch).", I think the status can be "Fixed".

kristiaanvandeneynde’s picture

Cheers everyone who contributed to this!

While it's sad to admit, the fact that I could not find the time to properly review this module is exactly the reason we need more entity types supported in their own modules. So I think it's great that the effort here made that happen for taxonomy terms.

Good job, everyone! I'll assign credit according to the message in #82.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

le72’s picture

At this moment the Group Taxonomy doesn't provide the desired functionality for Group, like OG Vocabulary did for Organic Groups.

The idea of the maintainer to have common core entity types supported out of the box by the Group module not implemented at this moment. They should also include Taxonomy and Menu, both are core entities.

le72’s picture

The idea is to provide each group with its own vocabularies (i.e. taxonomy). This lets groups logically segregate their content into categories that make sense for them.