Note that there are some explanatory texts on larger screens.

plurals
  1. PO"Could not install module" error in PyroCMS
    text
    copied!<p>I have been building a module in PyroCMS and have made its structure. I am using Streams API to build forms and perform my actions and also performed a dummy install to check if everything looks ok. Then I went on modifying the contents of the dummy and completing my structure. However, in the <code>details.php</code> file, I made a change where I created a foreign key (relationship type of field, if u know the API jargon) to retrieve a field from another stream(the other stream being defined after my current stream) and now when I install the module, it shows 'Could not install the module' error, but I can see the module has been installed. I have tried to comment out the foreign key reference, but the problem still persists.</p> <p>Here's my details.php file:</p> <p> <p>class Module_Employer extends Module {</p> <pre><code>public $version = '1.0'; public function info() { return array( 'name' =&gt; array( 'en' =&gt; 'Employer' ), 'description' =&gt; array( 'en' =&gt; 'Module for Employer' ), 'frontend' =&gt; true, 'backend' =&gt; true, 'menu' =&gt; 'content', 'shortcuts' =&gt; array( 'create' =&gt; array( 'name' =&gt; 'Employer:new', 'uri' =&gt; 'admin/employer/create', 'class' =&gt; 'add' ) ) ); } public function install() { // We're using the streams API to // do data setup. $this-&gt;load-&gt;driver('Streams'); $this-&gt;load-&gt;language('employer/emp'); // Add streams if ( ! $this-&gt;streams-&gt;streams-&gt;add_stream(lang('Employer:employers'), 'employers', 'employer', null, 'This is the Employer Stream')) return false; if ( ! $this-&gt;streams-&gt;streams-&gt;add_stream(lang('Employer:company'), 'company', 'company', null, 'This is the Company Stream')) return false; if ( ! $this-&gt;streams-&gt;streams-&gt;add_stream(lang('Employer:job'), 'jobs', 'job', null, 'This is the Job Stream')) return false; // Fields for employers table $employer_fields = array( array( 'name' =&gt; 'Name', 'slug' =&gt; 'name', 'namespace' =&gt; 'employer', 'type' =&gt; 'text', 'extra' =&gt; array('max_length' =&gt; 100), 'assign' =&gt; 'employers', 'title_column' =&gt; true, 'required' =&gt; true, 'unique' =&gt; true ), array( 'name' =&gt; 'Username', 'slug' =&gt; 'username', 'namespace' =&gt; 'employer', 'type' =&gt; 'text', 'extra' =&gt; array('max_length' =&gt; 100), 'assign' =&gt; 'employers', 'title_column' =&gt; true, 'required' =&gt; true, 'unique' =&gt; true ), array( 'name' =&gt; 'Password', 'slug' =&gt; 'password', 'namespace' =&gt; 'employer', 'type' =&gt; 'encrypt', 'extra' =&gt; array('hide_typing' =&gt; 'yes'), 'assign' =&gt; 'employers', 'title_column' =&gt; true, 'required' =&gt; true, 'unique' =&gt; true ), array( 'name' =&gt; 'Credits', 'slug' =&gt; 'credits', 'namespace' =&gt; 'employer', 'type' =&gt; 'integer', 'extra' =&gt; array('max_length' =&gt; 10), 'assign' =&gt; 'employers', 'title_column' =&gt; true, 'required' =&gt; true, 'unique' =&gt; true ), array( 'name' =&gt; 'Company name', 'slug' =&gt; 'company_name', 'namespace' =&gt; 'employer', 'type' =&gt; 'relationship', 'extra' =&gt; array('choose_stream' =&gt; 'company'), 'assign' =&gt; 'employers', 'title_column' =&gt; true, 'required' =&gt; false, 'unique' =&gt; false ) ); $this-&gt;streams-&gt;fields-&gt;add_fields($employer_fields); //Fields for company stream $company_fields = array( array( 'name' =&gt; 'Username', 'slug' =&gt; 'username', 'namespace' =&gt; 'company', 'type' =&gt; 'relationship', 'extra' =&gt; array('choose_stream' =&gt; 'employers'), 'assign' =&gt; 'company', 'title_column' =&gt; true, 'required' =&gt; false, 'unique' =&gt; false ), array( 'name' =&gt; 'E-mail', 'slug' =&gt; 'email', 'namespace' =&gt; 'company', 'type' =&gt; 'email', 'assign' =&gt; 'company', 'title_column' =&gt; true, 'required' =&gt; true, 'unique' =&gt; false ), array( 'name' =&gt; 'Company Name', 'slug' =&gt; 'company_name', 'namespace' =&gt; 'company', 'type' =&gt; 'text', 'extra' =&gt; array('max_length' =&gt; 100), 'assign' =&gt; 'company', 'title_column' =&gt; true, 'required' =&gt; true, 'unique' =&gt; true ), array( 'name' =&gt; 'Logo', 'slug' =&gt; 'logo', 'namespace' =&gt; 'company', 'type' =&gt; 'image', 'extra' =&gt; array('folder' =&gt; 'upload'), 'assign' =&gt; 'company', 'title_column' =&gt; true, 'required' =&gt; false, 'unique' =&gt; false ), array( 'name' =&gt; 'Designation', 'slug' =&gt; 'designation', 'namespace' =&gt; 'company', 'type' =&gt; 'text', 'extra' =&gt; array('max_length' =&gt; 100), 'assign' =&gt; 'company', 'title_column' =&gt; true, 'required' =&gt; false, 'unique' =&gt; false ), array( 'name' =&gt; 'Contact No.1', 'slug' =&gt; 'contact1', 'namespace' =&gt; 'company', 'type' =&gt; 'integer', 'extra' =&gt; array('max_length' =&gt; 10), 'assign' =&gt; 'company', 'title_column' =&gt; true, 'required' =&gt; true, 'unique' =&gt; false ), array( 'name' =&gt; 'Contact No.2', 'slug' =&gt; 'contact2', 'namespace' =&gt; 'company', 'type' =&gt; 'integer', 'extra' =&gt; array('max_length' =&gt; 10), 'assign' =&gt; 'company', 'title_column' =&gt; true, 'required' =&gt; false, 'unique' =&gt; false ), array( 'name' =&gt; 'Contact No.3', 'slug' =&gt; 'contact3', 'namespace' =&gt; 'company', 'type' =&gt; 'integer', 'extra' =&gt; array('max_length' =&gt; 10), 'assign' =&gt; 'company', 'title_column' =&gt; true, 'required' =&gt; false, 'unique' =&gt; false ), array( 'name' =&gt; 'Address', 'slug' =&gt; 'address', 'namespace' =&gt; 'company', 'type' =&gt; 'textarea', 'assign' =&gt; 'company', 'title_column' =&gt; true, 'required' =&gt; true, 'unique' =&gt; false ), array( 'name' =&gt; 'Billing ddress', 'slug' =&gt; 'billing_address', 'namespace' =&gt; 'company', 'type' =&gt; 'textarea', 'assign' =&gt; 'company', 'title_column' =&gt; true, 'required' =&gt; true, 'unique' =&gt; false ), ); $this-&gt;streams-&gt;fields-&gt;add_fields($company_fields); //Fields for company stream $job_desc_fields = array( array( 'name' =&gt; 'Username', 'slug' =&gt; 'username', 'namespace' =&gt; 'company', 'type' =&gt; 'relationship', 'extra' =&gt; array('choose_stream' =&gt; 'employers'), 'assign' =&gt; 'jobs', 'title_column' =&gt; true, 'required' =&gt; false, 'unique' =&gt; false ), array( 'name' =&gt; 'Key Skills', 'slug' =&gt; 'keyskills', 'namespace' =&gt; 'company', 'type' =&gt; 'textarea', 'assign' =&gt; 'jobs', 'title_column' =&gt; true, 'required' =&gt; true, 'unique' =&gt; false ), array( 'name' =&gt; 'Position Summary', 'slug' =&gt; 'position_summary', 'namespace' =&gt; 'company', 'type' =&gt; 'textarea', 'assign' =&gt; 'jobs', 'title_column' =&gt; true, 'required' =&gt; false, 'unique' =&gt; false ), array( 'name' =&gt; 'Experience', 'slug' =&gt; 'experience', 'namespace' =&gt; 'company', 'type' =&gt; 'text', 'assign' =&gt; 'jobs', 'title_column' =&gt; true, 'required' =&gt; true, 'unique' =&gt; false ), array( 'name' =&gt; 'Industry', 'slug' =&gt; 'industry', 'namespace' =&gt; 'company', 'type' =&gt; 'text', 'assign' =&gt; 'jobs', 'title_column' =&gt; true, 'required' =&gt; false, 'unique' =&gt; false ), array( 'name' =&gt; 'Functional Area', 'slug' =&gt; 'functional_area', 'namespace' =&gt; 'company', 'type' =&gt; 'text', 'assign' =&gt; 'jobs', 'title_column' =&gt; true, 'required' =&gt; false, 'unique' =&gt; false ), array( 'name' =&gt; 'Salary', 'slug' =&gt; 'salary', 'namespace' =&gt; 'company', 'type' =&gt; 'text', 'assign' =&gt; 'jobs', 'title_column' =&gt; true, 'required' =&gt; false, 'unique' =&gt; false ), array( 'name' =&gt; 'Start Date', 'slug' =&gt; 'start_date', 'namespace' =&gt; 'company', 'type' =&gt; 'datetime', 'assign' =&gt; 'jobs', 'extra' =&gt; array('input_type' =&gt; 'datepicker'), 'title_column' =&gt; true, 'required' =&gt; false, 'unique' =&gt; false ), array( 'name' =&gt; 'Job Type', 'slug' =&gt; 'job_type', 'namespace' =&gt; 'company', 'type' =&gt; 'choice', 'assign' =&gt; 'jobs', 'extra' =&gt; array('input_type' =&gt; 'datepicker'), 'title_column' =&gt; true, 'required' =&gt; false, 'unique' =&gt; false ), ); return true; } public function uninstall() { $this-&gt;load-&gt;driver('Streams'); $this-&gt;streams-&gt;utilities-&gt;remove_namespace('employer'); return true; } public function upgrade($old_version) { // Your Upgrade Logic return true; } public function help() { // Return a string containing help info // You could include a file and return it here. return "No documentation has been added for this module.&lt;br /&gt;Contact the module developer for assistance."; } </code></pre> <p>}</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload