Skip to content

Post-controller-constructor hook loses document data #1

@apcomplete

Description

@apcomplete

Using a post_controller_constructor hook to set document data.

If a controller exists, but does not define desired method (in this case index), document library loses document data set by the hook.

Steps to reproduce:

  1. /about page defined in database with body and view set to default
  2. About controller implemented with no index method
  3. Post_controller_constructor hook function:
     if ( ! function_exists('get_foo'))
     {
        function get_foo()
        {
            $CI = get_instance();
            $CI->document->data('foo','bar');
        }
    }
  1. Visit /about, echo $this->document->foo, index not set on $CI->document->data on page load

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions