formcreator icon indicating copy to clipboard operation
formcreator copied to clipboard

[v2.13.0-alpha.3] form accessible with link but not visible in dashboard + no form tab in menu

Open joomlafun opened this issue 3 years ago • 11 comments

Hi,

Both with standard interface and regular one, no forms are visible on the dashboard or in the menu even though you may access it with their direct link.(so form is properly configured to be visible)

I do not have the issue using an admin profile which does show the "assistance>forms" menu

To reproduce : Create a new profile with no permissions at all, then add standard in the permissions necessary for tickets view

GLPI 10 beta Screenshot_20220216_105138

Debian 4.19.208-1 (2021-09-29) x86_64 PHP 7.4.27

joomlafun avatar Feb 16 '22 10:02 joomlafun

Hi

Choose a form to investigate and check the language configured on the form. It must be "--- All languages --- or the same language of the user trying to see it.

Check also that the form is active

check the access type. Maybe there are restrictions which disallow the user to view it.

btry avatar Feb 16 '22 11:02 btry

Also check if the form is visible . This is a new setting introduced in 2.13.0.

btry avatar Feb 16 '22 11:02 btry

Yes, I checked all this before creating the ticket but it's good to check again. Language and everything mentionned is good.

What do you think over the fact that the forms menu link is not visible in the "assistance menu" when it is in the dashboard, they are both visible for admins though Screenshot_20220216_121602 .

joomlafun avatar Feb 16 '22 11:02 joomlafun

What do you think over the fact that the forms menu link is not visible in the "assistance menu" when it is in the dashboard

This means that Formcreator does not find any form to show. In this case, the menu entry is not displayed.

Maybe the forms are out of the scope of the user, from entity point of view ?

btry avatar Feb 16 '22 11:02 btry

I may have misunderstood where you expect to see your forms.

The "Forms" tab show forms only if you have "Direct access on homepage" enabled.

btry avatar Feb 16 '22 11:02 btry

Thank you for the help but the form is in the same entity as this user.

Well I expect to see the forms button in the assitance menu like it is the case for admin Screenshot_20220216_123823

Maybe there

joomlafun avatar Feb 16 '22 11:02 joomlafun

Ok; then there must be some condition not fulfilled.

Here is a sum up of the conditions, by reading the code, to ensure I don't forget anything

  • form must be active
  • form must not be deleted
  • form must be visible (this condition is currently missing in the code, being added today)
  • language is : not set or set to "all languages" or a form translation exists for the language of the current user
  • access right is not restricted (public or private access) or restricted with the current profile matching one of the allowed profiles
  • entities and recursion allow access to the form by the user and his current entity.

HEre is the SQL query ready to run if you want to do some tests in Mysql. Don't forget to adapt the language, the profiles_id. This example ran in root entity, then no condition is created for entity restriction.

By playing witrh conditions, disabling them one by one, you should be able to figure out which one cause a problem, and then check if at least one form is configured properly acordying to this condition.

SELECT
    COUNT(*) AS c
FROM
    `glpi_plugin_formcreator_forms`
    LEFT JOIN `glpi_plugin_formcreator_forms_languages` ON (
        `glpi_plugin_formcreator_forms_languages`.`plugin_formcreator_forms_id` = `glpi_plugin_formcreator_forms`.`id`
    )
WHERE
    `glpi_plugin_formcreator_forms`.`is_active` = '1'
    AND `glpi_plugin_formcreator_forms`.`is_deleted` = '0'
    AND `glpi_plugin_formcreator_forms`.`is_visible` = '1'
    AND (
        `glpi_plugin_formcreator_forms`.`language` IN ('en_US', '0', '', NULL)
        OR `glpi_plugin_formcreator_forms_languages`.`name` = 'en_US'
    )
    AND (
        (
            `glpi_plugin_formcreator_forms`.`access_rights` <> '2'
            OR `glpi_plugin_formcreator_forms`.`id` IN (
                SELECT
                    `plugin_formcreator_forms_id`
                FROM
                    `glpi_plugin_formcreator_forms_profiles`
                WHERE
                    `profiles_id` = '4'
            )
        )
    )

btry avatar Feb 16 '22 14:02 btry

the access right checking is not necessary as the form is public. For the rest, no error.

If you cannot reproduce the issue with instructions provided in the opening of this ticket ? then let's consider that issue is related to my glpi installation

Screenshot_20220216_161852

joomlafun avatar Feb 16 '22 15:02 joomlafun

If you cannot reproduce the issue with instructions provided in the opening of this ticket ?

I did not tried yet, as I already have some tasks to complete first.

So yout SQL query retunrs 1, then there should be 1 form available.

btry avatar Feb 16 '22 16:02 btry

There is no rush, I see you are mostly the only contributor to this plugin so we understand it takes time. And Thank you for providing it for free anyway

joomlafun avatar Feb 16 '22 16:02 joomlafun

To get more developers working on GLPI and its plugins, consider subscribing for professional support. You will have more priority for bugfixes and you may request new features development.

btry avatar Feb 16 '22 17:02 btry