Jump to content


Photo

_read table with Custom Object

custom object table

  • Please log in to reply
9 replies to this topic

#1 Sacha Telgenhof

Sacha Telgenhof

    Advanced Member

  • Members
  • PipPipPip
  • 86 posts
  • LocationTokyo, Japan

Posted 23 April 2013 - 01:15 AM

Hi,

 

Perhaps this has been discussed before, so my apologies...

I created a custom table and corresponding module and want to have it included as part of the installation. Unfortunately I receive an error message:

 

 

SQLSTATE[42S02]: Base table or view not found: 1146 Table '[db].[tablename]_read' doesn't exist.

 

Is there anything that I forgot to do or configure? I am using the development tree of Zurmo.

 

Thanks in advance!

 

Sacha Telgenhof



#2 raysto

raysto

    Zurmo Team

  • Administrators
  • 1,973 posts

Posted 23 April 2013 - 03:08 AM

Great to hear from you Sacha. I know you asked another question yesterday. Can you join our Dev Session tomorrow? We have Developer Sessions every Tuesday at 10:00AM Chicago Time (http://zurmo.org/for...arning-session/). We can answer both questions during the session.


Ray Stoeckicht
Zurmo Team
Try Zurmo Pro


#3 Sacha Telgenhof

Sacha Telgenhof

    Advanced Member

  • Members
  • PipPipPip
  • 86 posts
  • LocationTokyo, Japan

Posted 23 April 2013 - 04:10 AM

Hi Ray,

 

I would love to join those sessions, however I am living now in Japan which would mean 5am for me :(

Moving to Japan took most of my time and energy the last months, but now slowly wanted to get back into Zurmo again...

 

Cheers! Sacha



#4 Ivica

Ivica

    Advanced Member

  • Moderators
  • 565 posts

Posted 23 April 2013 - 11:01 AM

Have you included model classnames in your module class? Check example below from AccountsModule:

 

public function getRootModelNames()
{
    return array('Account');
}

 

Also after you do this modification, you need to update schema.

Let us know if this helped.



#5 Sacha Telgenhof

Sacha Telgenhof

    Advanced Member

  • Members
  • PipPipPip
  • 86 posts
  • LocationTokyo, Japan

Posted 23 April 2013 - 02:24 PM

Hi Ivica,

 

Thanks! I overlooked that one.. I will try that..

 

Cheers! Sacha



#6 Sacha Telgenhof

Sacha Telgenhof

    Advanced Member

  • Members
  • PipPipPip
  • 86 posts
  • LocationTokyo, Japan

Posted 24 April 2013 - 12:41 AM

I have added that part, however the _read table is not created upon installation.



#7 Ivica

Ivica

    Advanced Member

  • Moderators
  • 565 posts

Posted 24 April 2013 - 03:59 AM

Those fields should be created during: ReadPermissionsOptimizationUtil::rebuild() function, and to have those _read tables, your model must be subclass of SecurableItem and to have function hasReadPermissionsOptimization() which should return true. 



#8 Sacha Telgenhof

Sacha Telgenhof

    Advanced Member

  • Members
  • PipPipPip
  • 86 posts
  • LocationTokyo, Japan

Posted 24 April 2013 - 04:19 AM

I basically cloned the "Accounts" module, so the model and everything else is the same. Just it's named differently...:(



#9 Sacha Telgenhof

Sacha Telgenhof

    Advanced Member

  • Members
  • PipPipPip
  • 86 posts
  • LocationTokyo, Japan

Posted 24 April 2013 - 05:59 AM

I turned the hasReadPermissionsOptimization off for now in my Model. Don't need it yet.



#10 Jason

Jason

    Administrator

  • Administrators
  • 864 posts
  • LocationChicago

Posted 24 April 2013 - 04:03 PM

in your XXModule.php 

 

 

        public static function hasPermissions()
        {
            return true;
        }
 
you need that

Jason Green
Zurmo Team
Need support? Upgrade now






Also tagged with one or more of these keywords: custom, object, table

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users