QloApps Forums
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    New Hotel Permission cannot be added to existing profiles

    Technical Help
    5
    8
    1141
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      leokonwar last edited by

      When I add a new hotel and add permission to an existing profile it does not save. But if I create a new profile then I can give permission to existing hotel. Means Hotel needs to be there before adding profile else can't give permission in existing profiles for newly added hotels. Is it a bug or am I missing something?

      A 1 Reply Last reply Reply Quote 0
      • A
        akr Global Moderator @leokonwar last edited by

        @leokonwar Thank you for reporting this issue to us.

        This issue has been identified and fixed already in the upcoming version of QloApps v1.6.1.

        The following PR fixes this issue. You can merge changes in this PR into your codebase to fix the issue.

        PR link: https://github.com/Qloapps/QloApps/pull/729

        L 1 Reply Last reply Reply Quote 0
        • L
          leokonwar last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • L
            leokonwar @akr last edited by

            @akr Thank you for your support.

            1 Reply Last reply Reply Quote 0
            • A
              Ananthlingam last edited by

              hotels can not added on other roles , only superadmin can view, once if add hotes other roles it is not Saving

              1 Reply Last reply Reply Quote 0
              • A
                Aman deep sharma Global Moderator last edited by qloadmin

                @Ananthlingam In order to fix your issue regarding
                the PR kindly follow the steps given below :

                1) Run the provided sql query on your database.

                Please ensure to replace "prefix_" with the table prefix you set during the QloApps installation.

                To find your table prefix, follow these steps:

                1. Navigate to the "Advanced Parameters -> Configuration Information" Tab. Refer to the screenshot [https://tinyurl.com/537w7ft5]

                2. Obtain the table prefix from the Configuration Information page. Refer to the screenshot [https://tinyurl.com/ymvte45m]

                3. Replace "prefix_" with your actual table prefix in the query provided below.

                SQL query :

                INSERT INTO `prefix_htl_access` (`id_profile`, `id_hotel`, `access`)
                SELECT p.`id_profile`, h.`id` AS `id_hotel`, CASE WHEN p.`id_profile` = 1 THEN 1 ELSE 0 END AS `access`
                FROM `prefix_profile` p
                CROSS JOIN `prefix_htl_branch_info` h
                LEFT JOIN `prefix_htl_access` ha ON (p.`id_profile` = ha.`id_profile` AND h.`id` = ha.`id_hotel`)
                WHERE ha.`id_profile` IS NULL;
                

                2) Once you've completed the above step, then merge the following PR:

                PR link : https://github.com/Qloapps/QloApps/pull/729

                1 Reply Last reply Reply Quote 0
                • Referenced by  A Aman deep sharma 
                • A
                  Ananth last edited by

                  Where do i find below SQl query

                  SQL query :

                  INSERT INTO prefix_htl_access (id_profile, id_hotel, access)
                  SELECT p.id_profile, h.id AS id_hotel, CASE WHEN p.id_profile = 1 THEN 1 ELSE 0 END AS access
                  FROM prefix_profile p
                  CROSS JOIN prefix_htl_branch_info h
                  LEFT JOIN prefix_htl_access ha ON (p.id_profile = ha.id_profile AND h.id = ha.id_hotel)
                  WHERE ha.id_profile IS NULL;

                  790546ed-bff1-4aa1-af0a-716f85b09181-image.png

                  1 Reply Last reply Reply Quote 0
                  • A
                    Aman deep sharma Global Moderator last edited by Aman deep sharma

                    Hi @Ananth,

                    You don't have to find the query you just need to run the given SQL in your database to fix the issue. You can do this by your own or you can ask from you host provider to execute this query on your database.

                    SQL query :

                    INSERT INTO `prefix_htl_access` (`id_profile`, `id_hotel`, `access`)
                    SELECT p.`id_profile`, h.`id` AS `id_hotel`, CASE WHEN p.`id_profile` = 1 THEN 1 ELSE 0 END AS `access`
                    FROM `prefix_profile` p
                    CROSS JOIN `prefix_htl_branch_info` h
                    LEFT JOIN `prefix_htl_access` ha ON (p.`id_profile` = ha.`id_profile` AND h.`id` = ha.`id_hotel`)
                    WHERE ha.`id_profile` IS NULL;
                    

                    But make sure to replace 'prefix' in the SQL query with your table prefix so that SQL query can run correctly. Whenever the QloApps installed you have to mention the Table prefix at the time of installation.

                    To find your table prefix, follow these steps:

                    • Navigate to the "Advanced Parameters -> Configuration Information" Tab. Refer to the screenshot

                    • Obtain the table prefix from the Configuration Information page. Refer to the screenshot

                    Once you've completed the above step, then merge the following PR: https://github.com/Qloapps/QloApps/pull/729

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post