Hi,
I have selected only one content type in glossify configuration "Target content types" and a few other content type in "Content types to be filtered". But I can see the Glossify 2 internal fields in all content types when I create a new node of any type or edit an existing one.
If I followed the reasonning correctly, the correct behavior should be that it should only have internal fields for the one content type I selected in "Target content types", am I wrong?

It is not important since it doesn't affect anything, but still I think it is a bug, especially since there is no permission that handle this. The permission administer glossify is not about that, it is about the configuration of glossify, so on my multi users site, everybody who can create a node of any type can put something in those fields, it is confusing because the content types they can create have nothing to do with glossify.. I'd like those internal fields to not be there or at least have a permission so that they don't display to roles like authentificated.

Where do you think I could fix that in the module?

Comments

alliax’s picture

Hi again, I have worked it out by myself where to fix that in the glossify.module but I'm totally not sure about the implications of my fix..

So please mister maintainer, if you could review my changes, make the fix as it should be, the proper way and when you include it in the dev version or even better in a new beta release, then please update this issue so I'll know that I can replace the module with the current version.

I still don't know how to do a patch, but really this was easy, it was simply a matter of checking that the content type is one of those in the configuration "Target content types"..

So, in glossify.module, in the function function glossify_form_alter(&$form, $form_state, $form_id) {

at line 121 (version 6, beta 11) it was like that:

   foreach ($configurations as $configuration) {      
	    if ($configuration['methods']['use_internal']) {
          $use_internal = TRUE;
          }
    }

and I've added the condition to check if the node type is within the target content types, like so:

   foreach ($configurations as $configuration) {
      if (in_array($form['type']['#value'], $configuration['to'])) {
	    if ($configuration['methods']['use_internal']) {
          $use_internal = TRUE;
        }
	  }
    }

Please if something is wrong, let me know, thank you.. From what I see it is working, the glossify 2 internal fields appear only in my content type dedicated to glossify. I use glossify in a simple way, only for external urls via the internal method, so I don't know if this would work in other cases such as having 2 or more Target content types.

alliax’s picture

Status: Active » Needs review

Please review (sorry I forgot to change the status in my previous post)

WorldFallz’s picture

Status: Fixed » Closed (fixed)

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