I just updated to the latest build and found that I can't access my advanced module in the CMS. Not sure what happened though.
Once I changed back to the previous build I had it worked again, unfortunately the update I was looking for won't work until I can get the new build.
Just an FYI.
Thanks.
Comments
'type' => 'textarea' shows as it should.
What 'type' is supposed to give you a standard input?
I'm seeing the same thing with 'type' => 'file' which shows up as 'type' => 'asset'.
'type' => 'asset' shows as it should.
kinda odd?
With regards to the form fields, 'type' => 'text' has a "representative" assigned to it to show the textarea. This is mainly because of the field type "text" in MySQL and realize it may be a little confusing. If you want a text field, just leave the "type" attribute blank.
Also, if you are seeing an asset upload instead of "file" field type, it probably is because you have "image" or "img" in your field name. To get around this, you can add the parameter to your field of "ignore_representative" => TRUE.
An Error Was Encountered<br /> You are missing the module membership.
But the user_guide module still works fine. Just my user created one.
Thanks for the tips on those form fields. I'll give that a try!
1. What is the URI giving you that error?
2. Is the name of the advanced module "membership" that exists in the folder "fuel/modules/membership"?
3. Does this advanced module have a model of "membership" (fuel/modules/membership/models/membership_model.php) and is associated with a simple module (sub module) in the simple module config (fuel/modules/membership/config/membership_fuel_modules.php)?
2) yes
3) there is no membership_model.php in /fuel/modules/membership/models/ just the models that are routed: members_model.php and groups_model.php.
What would go in the membership_model.php file since I don't access it directly?
$config['modules']['members'] = array( 'model_location' => 'membership', 'module_name' => 'Members', 'module_uri' => 'membership/members', 'model_name' => 'members_model', 'nav_selected' => 'membership/members', ); $config['modules']['groups'] = array( 'model_location' => 'membership', 'module_name' => 'Member Groups', 'module_uri' => 'membership/groups', 'model_name' => 'groups_model', 'nav_selected' => 'membership/groups', );
I don't have a fuel/modules/membership/config/membership_fuel_modules.php
Thanks.
When I logged in as the new user with proper permissions he was able to access the added simple modules but wasn't able to click/edit any of the rows.
As for the advanced modules, even though proper permissions were given, he wasn't able to even see those in the list.
This is probably not related to your update Sunday as today was the first time I've had to use that user in a couple weeks. I even updated with the latest update today which was 5 hours old, but no change.
I made him SuperAdmin for now, but figured you should be aware.
$reviews = $CI->reviews_model->find_all($where_clause, 'date_created desc', $limit , $this->input->get('per_page') , 'object'); $record_count = $CI->reviews_model->record_count($where_clause);
This failed when I had _common_query set to include 2 joins as it wasn't able to include the 2 model's data in the SELECT string and came back with the following error:
A Database Error Occurred Error Number: 1054 Unknown column 'restaurants.name' in 'where clause' SELECT * FROM (`testimonials`) WHERE `published` = 'yes' AND `restaurants`.`name` = 'Joe\'s Sandwich Shop' Filename: /home/eng51dev/public_html/restautrade/fuel/modules/fuel/core/MY_Model.php Line Number: 1368
So, all I did to get around it was a 2nd regular find_all($where_clause) which worked fine.
php index.php fuel/generate/simple my_simple_module_name
For number 2, _common_query is only used for "find_" methods on the model. To use it with record_count, just call _common_query right before it:
$reviews = $CI->reviews_model->find_all($where_clause, 'date_created desc', $limit , $this->input->get('per_page') , 'object'); $CI->reviews_model->_common_query(); $record_count = $CI->reviews_model->record_count($where_clause);
- Model: Edit (model/edit)
- Model: Publish (model/publish)
- Model: Delete (model/delete)
- Model: Create (model/create)
So cool. Too bad when adding a model in the permission section (when not using the command line utility) it couldn't automatically create those, or at least give the option. Just wishful thinking of course#2) I hadn't realized this. But makes sense and helps me work out a problem I was having too.
I have my advanced module created already, just need to allow it to be added to a user.
I noticed when I tried to add the User_manual module to a user I had the same thing happen. But when I used the script to add an advanced module, the permissions were setup correctly.
Also, we've thought about having that auto-generation of those other permissions as well.
An Error Was Encountered You do not have access to this page.
I changed the permissions as such:
- Membership (membership)
- Users (membershp/users)
- Users: Edit (membership/users/edit)
etc.Still missing something though.
The advanced module is called Membership with a Users model in the models folder. They are accessible as super admin.
Fuel_admin::validate_user('membership/members','edit',TRUE);die();
to my members_model construct. And received no messages at all (for admin and my user).
Then I added
echo 'test';exit();
to Fuel_admin method validate_user() right after the opening of the method. This returned: test to my screen. If I put it within the first if: it returned nothing. This leads me to believe both users have access to model.I revoked edit,publish,create,delete access from the user leaving access to members within membership only. There were still no messages, even when testing for 'edit' access. If I removed members from the list, that model isn't visible in the left nav.
What should I test next?
function validate_user($permission, $type = 'edit', $show_error = TRUE) { echo '<pre>'; print_r($permission); print_r($type); echo '</pre>'; exit(); if (!$this->fuel->auth->has_permission($permission, $type)) { if ($show_error) { show_error(lang('error_no_access')); } else { exit(); } } }
Array ( [0] => members [1] => create [2] => edit [3] => publish [4] => delete [5] => export )
This was for both admin and user.
members members/create members/edit members/publish members/delete members/export groups groups/create groups/edit groups/publish groups/delete groups/export
BTW, we've added the ability to generate those other permissions when creating a permission (not on edit).
I then adjusted my Membership module to match in the config/membership.php and the database/permissions sections, but I'm still missing something.
I don't understand where the issue is as it looks correct.
With the setup as you just posted my membership module doesn't even show up for my user (of course it shows for my admin though). It used to show when membership/ was added to the front of each item though.
<?php $route[FUEL_ROUTE.'membership'] = 'membership'; $membership_controllers = array('members', 'groups'); foreach($membership_controllers as $c) { $route[FUEL_ROUTE.$route[FUEL_ROUTE.'membership'].'/'.$c] = FUEL_FOLDER.'/module'; $route[FUEL_ROUTE.$route[FUEL_ROUTE.'membership'].'/'.$c.'/(.*)'] = FUEL_FOLDER.'/module/$1'; }</code
ie:
$config['modules']['members'] = array( 'model_location' => 'membership', 'module_name' => 'Members', 'module_uri' => 'membership/members', 'model_name' => 'members_model', 'nav_selected' => 'membership/members', 'permission' => 'members' );
Then the permissions can be set simply as admin stated 5 posts up.
So simple