Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Bonk Error when attempting to Edit/Add Roles

2

Comments

  • r0obertr0obert
    edited May 2014

    @peregrine said:
    you imported or exported what to where.

    I a) emptied the GDN_Permission and GDN_Role (new) and b) Imported the two tables I originally exported in step 1 into the new install (/folder).

  • peregrineperegrine MVP
    edited May 2014

    I understand now.

    can you edit the categories by going into categories.

    i didn't think about custom categories which wouldn't have been in the permissions table.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • r0obertr0obert
    edited May 2014

    @peregrine said:

    I understand now.

    can you edit the categories by going into categories.

    i didn't think about custom categories which wouldn't have been in the permissions table.

    Yes. So I need to do the same with the tables that contain the custom categories? (not sure where they are located exactly)

  • peregrineperegrine MVP
    edited May 2014

    I'm talking about going through the dashboard not editing tables.

    if you can edit categories and save each category it should update your permissions. and you should then be able to go into admin and edit categories now within the admin role as well (where you had an error before).

    does that fix things up.

    how many categories do you have and how many roles do you have.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • r0obertr0obert
    edited May 2014

    @peregrine said:
    go into categories and try to edit there.

    Not working, same error. I can edit pretty much everything BUT the custom permissions for each category.

    @peregrine said:
    how many categories do you have and how many roles do you have.

    2 custom perm categories and 2 extra roles (besides the standard ones).

  • peregrineperegrine MVP
    edited May 2014

    only the custom categories you can't edit or the other categories as well?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • r0obertr0obert
    edited May 2014

    @peregrine said:
    how many categories do you have?

    8 total, 2 with custom permissions

  • only the custom categories you can't edit or the other categories as well?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine said:
    only the custom categories you can't edit or the other categories as well?

    I get an error on all categories whenever I click on "This category has custom permissions" and then "Save".

  • peregrineperegrine MVP
    edited May 2014

    1.

    run this in phpmyadmin

    SELECT CategoryID FROM GDN_Category

    and post your results.

    2.
    also what is the error message you get again.

    3.
    can you save everything else you change via dashboard (other permission for roles) but only have a problem with categoriy permission changes saving.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • r0obertr0obert
    edited May 2014

    @peregrine said:
    1.

    run this in phpmyadmin

    SELECT CategoryID FROM GDN_Category

    and post your results.

    2.
    also what is the error message you get again.

    3.
    can you save everything else you change via dashboard (other permission for roles) but only have a problem with categoriy permission changes saving.

    1. Fatal Error in PDOStatement.execute();
      PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
      The error occurred on or near: /home/waeph/public_html/fresh/library/database/class.database.php

      289:          $PDOStatement = $this->Connection()->prepare($Sql);
      290: 
      291:          if (!is_object($PDOStatement)) {
      292:             trigger_error(ErrorMessage('PDO Statement failed to prepare', $this->ClassName, 'Query', $this->GetPDOErrorMessage($this->Connection()->errorInfo())), E_USER_ERROR);
      293:          } else if ($PDOStatement->execute($InputParameters) === FALSE) {
      294:             trigger_error(ErrorMessage($this->GetPDOErrorMessage($PDOStatement->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
      295:          }
      296:       } else {
      297:          $PDOStatement = $this->Connection()->query($Sql);
      
    2. Yes. (if that was a question)

    3.png 22.8K
  • ok now can you give me a screenshot of the permissions table.

    with these columns PermissionID RoleID JunctionTable JunctionColumn JunctionID

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine said:
    ok now can you give me a screenshot of the permissions table.

    with these columns PermissionID RoleID JunctionTable JunctionColumn JunctionID

    4.png 42.1K
  • peregrineperegrine MVP
    edited May 2014

    ok insert a few more records into the permissions table

    try adding records

    permission id 17
    roleid  16
    junctiontable  category
    junctioncolumn PermissionCategoryID 
    junctionID  12
    
    permission id 18
    roleid  16
    junctiontable  category
    junctioncolumn PermissionCategoryID 
    junctionID  13
    
    permission id 19
    roleid  16
    junctiontable  category
    junctioncolumn PermissionCategoryID 
    junctionID  14
    
    permission id 20
    roleid  16
    junctiontable  category
    junctioncolumn PermissionCategoryID 
    junctionID  15
    
    permission id 21
    roleid  16
    junctiontable  category
    junctioncolumn PermissionCategoryID 
    junctionID  16
    
    
    permission id 22
    roleid  16
    junctiontable  category
    junctioncolumn PermissionCategoryID 
    junctionID  17
    
    
    permission id 23
    roleid  16
    junctiontable  category
    junctioncolumn PermissionCategoryID 
    junctionID  18
    
    
    permission id 24
    roleid  16
    junctiontable  category
    junctioncolumn PermissionCategoryID 
    junctionID  19
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • r0obertr0obert
    edited May 2014
    5.png 68.9K
  • any luck with custom permissions on any category now?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine said:
    any luck with custom permissions on any category now?

    Unfortunately not.

  • peregrineperegrine MVP
    edited May 2014

    sorry, I surrender, and i don't know.

    you should probably drop the permissions and roles table in the new database, and import the ones from your old live database into the new database and you will be back to where you started.

    I don't know know how to solve.

    something with your database seems to be not right. because a clean install works.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • r0obertr0obert
    edited May 2014

    Can't I just backup my old db (minus role/permission tables) and delete everything, do a clean install of vanilla and then import my db and assign roles from scratch? Will this work?

  • the only other thing to try if you are not tired. is to install new database.

    add all the categories (to mimic your old database). ( the 8 with two custom permissions)

    add the extra roles as well (to mimic your old database).

    then save the role and permissions tables with the above changes.

    try editing roles and categories.

    then import the old database again.

    and then import the two new tables roles and permissions and see if that works.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.