milesj / admin

[Deprecated] A CakePHP plugin that provides admin CRUD functionality for app and plugin models.
MIT License
48 stars 21 forks source link

admin.ctp view layout bug on the Models page #7

Closed justinhartman closed 11 years ago

justinhartman commented 11 years ago

On the /admin/index page you have buttons for:

All my buttons work correctly except the Models one. When I click it, this is how my page loads: screen shot 2013-08-19 at 3 49 37 pm

If you look at the source of the HTML it's not loading the main admin.ctp file as the code just loads the content view:

<div class="action-buttons">
    <a href="/hrinduction/admin/index" class="btn btn-large"><span class="icon-paste"></span> Plugins</a><a href="/hrinduction/admin/models" class="btn btn-large active"><span class="icon-file"></span> Models</a><a href="/hrinduction/admin/config" class="btn btn-large"><span class="icon-cog"></span> Configuration</a><a href="/hrinduction/admin/cache" class="btn btn-large"><span class="icon-hdd"></span> Cache</a><a href="/hrinduction/admin/routes" class="btn btn-large"><span class="icon-road"></span> Routes</a>
    <span class="clear"></span>
</div>
<h2>Models</h2>

<table class="table table-striped table-bordered sortable">
    <thead>
        <tr>
            <th><span>Model</span></th>
            <th><span class="tip" title="Primary Key">PK</span></th>
            <th><span>Display Field</span></th>
            <th><span>Database</span></th>
            <th><span>Table</span></th>
            <th><span>Schema</span></th>
            <th><span>Behaviors</span></th>
            <th><span>Belongs To</span></th>
            <th><span>Has One</span></th>
            <th><span>Has Many</span></th>
            <th><span class="tip" title="Has and Belongs to Many">HABTM</span></th>
        </tr>
    </thead>
    <tbody>

            <tr class="info">
                <td colspan="11"><b>Admin</b></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/admin.action_log/index">ActionLog</a>               </td>
                <td>id</td>
                <td>
                    item                </td>
                <td>default</td>
                <td>admin_action_logs</td>
                <td>id, user_id, action, model, foreign_key, item, comment, created</td>
                <td>Containable, Utility.Cacheable, Utility.Enumerable</td>
                <td>User</td>
                <td></td>
                <td></td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/admin.control_object/index">ControlObject</a>               </td>
                <td>id</td>
                <td>
                    alias               </td>
                <td>default</td>
                <td>acos</td>
                <td>id, parent_id, model, foreign_key, alias, lft, rght</td>
                <td>Containable, Tree, Utility.Cacheable</td>
                <td>Parent, User</td>
                <td></td>
                <td>Children</td>
                <td>RequestObject</td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/admin.item_report/index">ItemReport</a>             </td>
                <td>id</td>
                <td>
                                            <span class="label label-warning">N/A</span>
                                    </td>
                <td>default</td>
                <td>admin_item_reports</td>
                <td>id, reporter_id, resolver_id, status, type, model, foreign_key, item, reason, comment, created, modified</td>
                <td>Containable, Utility.Cacheable, Utility.Enumerable</td>
                <td>Reporter, Resolver</td>
                <td></td>
                <td></td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/admin.object_permission/index">ObjectPermission</a>             </td>
                <td>id</td>
                <td>
                                            <span class="label label-warning">N/A</span>
                                    </td>
                <td>default</td>
                <td>aros_acos</td>
                <td>id, aro_id, aco_id, _create, _read, _update, _delete</td>
                <td>Containable, Utility.Enumerable</td>
                <td>ControlObject, RequestObject</td>
                <td></td>
                <td></td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/admin.request_object/index">RequestObject</a>               </td>
                <td>id</td>
                <td>
                    alias               </td>
                <td>default</td>
                <td>aros</td>
                <td>id, parent_id, model, foreign_key, alias, lft, rght</td>
                <td>Containable, Tree, Utility.Cacheable</td>
                <td>Parent, User</td>
                <td></td>
                <td>Children</td>
                <td>ControlObject</td>
            </tr>

            <tr class="info">
                <td colspan="11"><b>Core</b></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.activity/index">Activity</a>               </td>
                <td>id</td>
                <td>
                                            <span class="label label-warning">N/A</span>
                                    </td>
                <td>default</td>
                <td>activities</td>
                <td>id, category_name, activity_section_id, added, deleted</td>
                <td></td>
                <td>ActivitySection</td>
                <td></td>
                <td></td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.activity_item/index">ActivityItem</a>              </td>
                <td>id</td>
                <td>
                                            <span class="label label-warning">N/A</span>
                                    </td>
                <td>default</td>
                <td>activity_items</td>
                <td>id, activity_section_id, item_name, description, added, updated, deleted</td>
                <td></td>
                <td>ActivitySection</td>
                <td></td>
                <td></td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.activity_log/index">ActivityLog</a>                </td>
                <td>id</td>
                <td>
                                            <span class="label label-warning">N/A</span>
                                    </td>
                <td>default</td>
                <td>activity_logs</td>
                <td>id, activity_section_id, member_id, completed, added, updated, deleted</td>
                <td></td>
                <td>ActivitySection, Member</td>
                <td></td>
                <td>Newsfeed</td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.activity_section/index">ActivitySection</a>                </td>
                <td>id</td>
                <td>
                                            <span class="label label-warning">N/A</span>
                                    </td>
                <td>default</td>
                <td>activity_sections</td>
                <td>id, section_name, description, image, added, updated, deleted</td>
                <td></td>
                <td></td>
                <td></td>
                <td>Activity, ActivityItem, ActivityLog</td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.business_unit/index">BusinessUnit</a>              </td>
                <td>id</td>
                <td>
                    name                </td>
                <td>default</td>
                <td>business_units</td>
                <td>id, name, deleted</td>
                <td></td>
                <td></td>
                <td></td>
                <td>Member, Speaker</td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.comment/index">Comment</a>             </td>
                <td>id</td>
                <td>
                                            <span class="label label-warning">N/A</span>
                                    </td>
                <td>default</td>
                <td>comments</td>
                <td>id, member_id, page_id, comment, added, deleted</td>
                <td></td>
                <td>Member, Page</td>
                <td></td>
                <td>Newsfeed</td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.employment_type/index">EmploymentType</a>              </td>
                <td>id</td>
                <td>
                    name                </td>
                <td>default</td>
                <td>employment_types</td>
                <td>id, name, deleted</td>
                <td></td>
                <td></td>
                <td></td>
                <td>Member</td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.event/index">Event</a>             </td>
                <td>id</td>
                <td>
                                            <span class="label label-warning">N/A</span>
                                    </td>
                <td>default</td>
                <td>events</td>
                <td>id, grade_id, time, venue, address, agenda, added, deleted</td>
                <td></td>
                <td>Grade</td>
                <td></td>
                <td>Newsfeed, Speaker</td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.feedback/index">Feedback</a>               </td>
                <td>id</td>
                <td>
                                            <span class="label label-warning">N/A</span>
                                    </td>
                <td>default</td>
                <td>feedbacks</td>
                <td>id, member_id, text, sent, deleted</td>
                <td></td>
                <td>Member</td>
                <td></td>
                <td>Newsfeed</td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.grade/index">Grade</a>             </td>
                <td>id</td>
                <td>
                                            <span class="label label-warning">N/A</span>
                                    </td>
                <td>default</td>
                <td>grades</td>
                <td>id, class_period, added, deleted</td>
                <td></td>
                <td></td>
                <td></td>
                <td>Event, Member, Newsfeed</td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.job_level/index">JobLevel</a>              </td>
                <td>id</td>
                <td>
                    name                </td>
                <td>default</td>
                <td>job_levels</td>
                <td>id, name, delete</td>
                <td></td>
                <td></td>
                <td></td>
                <td>Member, Speaker</td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.member/index">Member</a>               </td>
                <td>id</td>
                <td>
                    surname             </td>
                <td>default</td>
                <td>members</td>
                <td>id, firstname, surname, deloitte_email, other_email, telephone, password, grade_id, service_line_id, business_unit_id, job_level_id, office_location_id, employment_type_id, photo, aspirations, facebook_profile, twitter_profile, linkedin_profile, yammer_groups, added, updated, deleted</td>
                <td></td>
                <td>BusinessUnit, EmploymentType, Grade, JobLevel, OfficeLocation, ServiceLine</td>
                <td></td>
                <td>ActivityLog, Comment, Feedback</td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.newsfeed/index">Newsfeed</a>               </td>
                <td>id</td>
                <td>
                                            <span class="label label-warning">N/A</span>
                                    </td>
                <td>default</td>
                <td>newsfeeds</td>
                <td>id, activity_log_id, comment_id, feedback_id, event_id, grade_id, is_admin, is_global, added, deleted</td>
                <td></td>
                <td>ActivityLog, Comment, Event, Feedback, Grade</td>
                <td></td>
                <td></td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.office_location/index">OfficeLocation</a>              </td>
                <td>id</td>
                <td>
                    name                </td>
                <td>default</td>
                <td>office_locations</td>
                <td>id, name, address, telephone, deleted</td>
                <td></td>
                <td></td>
                <td></td>
                <td>Member, Speaker</td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.page/index">Page</a>               </td>
                <td>id</td>
                <td>
                    title               </td>
                <td>default</td>
                <td>pages</td>
                <td>id, title, slug, body, tags, added, updated, published, deleted</td>
                <td></td>
                <td></td>
                <td></td>
                <td>Comment</td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.service_line/index">ServiceLine</a>                </td>
                <td>id</td>
                <td>
                    name                </td>
                <td>default</td>
                <td>service_lines</td>
                <td>id, name, deleted</td>
                <td></td>
                <td></td>
                <td></td>
                <td>Member, Speaker</td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/core.speaker/index">Speaker</a>             </td>
                <td>id</td>
                <td>
                                            <span class="label label-warning">N/A</span>
                                    </td>
                <td>default</td>
                <td>speakers</td>
                <td>id, firstname, surname, bio, photo, service_line_id, business_unit_id, job_level_id, office_location_id, event_id, added, updated, deleted</td>
                <td></td>
                <td>BusinessUnit, Event, JobLevel, OfficeLocation, ServiceLine</td>
                <td></td>
                <td></td>
                <td></td>
            </tr>

            <tr>
                <td>
                    <a href="/hrinduction/admin/crud"></a>              </td>
                <td></td>
                <td>
                                            <span class="label label-warning">N/A</span>
                                    </td>
                <td></td>
                <td></td>
                <td>
milesj commented 11 years ago

Have you modified or configured the admin at all because it's working fine here. What version are you running?

justinhartman commented 11 years ago

I assume I am running 1.1.1 because I set my composer.json up as follows:

    "require": {
        "ext-mbstring": "*",
        "composer/installers": "*",
        "mjohnson/decoda": "6.2.*",
        "titon/utility": "0.9.*",
        "mjohnson/utility": "1.*",
        "mjohnson/admin": "*",
        "mjohnson/uploader": "4.*"
    }

I also did a composer.phar update this afternoon and it updated the following to the latest version but everything else was seemingly up to date. Transit and Uploader was new items I added this afternoon:

Justins-MacBook-Air:app justinhartman$ php composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing mjohnson/decoda (6.2.1)
  - Installing mjohnson/decoda (6.2.2)
    Downloading: 100%

  - Installing mjohnson/transit (1.4.1)
    Downloading: 100%

  - Installing mjohnson/uploader (4.3.1)
    Downloading: 100%

mjohnson/transit suggests installing aws/aws-sdk-php (~2.2)
mjohnson/uploader suggests installing aws/aws-sdk-php (~2.2)
Writing lock file
Generating autoload files
justinhartman commented 11 years ago

Sorry, to answer your first question, the only file I edited was the admin.ctp file as I wanted to incorporate a logo and change elements such as footer etc. I basically only edited view files.

justinhartman commented 11 years ago

Is there an easy way to re-install the plugin and start with a completely fresh version to see if this problem still exists?

milesj commented 11 years ago

You need to delete the plugin and the composer.lock file then run the install/update again.

You also shouldn't edit the plugin files directly. If you need to change the layout, there is a setting you can change: Configure::write('Admin.viewLayout', 'yourLayout');. Simply create the layout and alter it.

justinhartman commented 11 years ago

I did a fresh install to 1.1.2 and this is now resolved! Must have been something wrong on my side.