#6288: PaginationHelper won't accept absolute URL
---------------------------+------------------------------------------------
    Reporter:  paddyforan  |          Type:  Bug    
      Status:  new         |      Priority:  Medium 
   Milestone:  1.2.x.x     |     Component:  Helpers
     Version:  1.2 Final   |      Severity:  Normal 
    Keywords:  paginator   |   Php_version:  PHP 5  
Cake_version:  1.2.2.8120  |  
---------------------------+------------------------------------------------
 The PaginationHelper next/prev methods only accept Router::url arrays, and
 do not accept the absolute 'http://' values that can be used elsewhere.
 [[BR]][[BR]]

 What I Did:
 [[BR]]
 [[BR]]
 I used $paginator->next('Next >', array('url' =>
 'http://subdomain.mydomain.com'), null, array()); to generate a pagination
 link.
 [[BR]]
 [[BR]]
 What I Expected:
 [[BR]]
 [[BR]]
 I expected a link pointing to "http://subdomain.mydomain.com/page:2"; and
 titled "Next >".
 [[BR]]
 [[BR]]
 What I Got:
 [[BR]]
 [[BR]]
 The following error:
 [[BR]]
 [[BR]]
 {{{
 Warning (2): array_merge() [function.array-merge]: Argument #2 is not an
 array [CORE/cake/libs/view/helpers/paginator.php, line 312]

 Code | Context

 $which  =       "Next"
 $title  =       "Older >"
 $options        =       array(
         "class" => "pagination",
         "style" => "float: right;"
 )
 $disabledTitle  =       null
 $disabledOptions        =       array(
         "class" => "disabled",
         "style" => "float: right;"
 )
 $check  =       "hasNext"
 $_defaults      =       array(
         "url" => array(),
         "step" => 1,
         "escape" => true,
         "model" => null,
         "tag" => "div"
 )
 $paging =       array(
         "page" => 1,
         "current" => 20,
         "count" => 21,
         "prevPage" => false,
         "nextPage" => true,
         "pageCount" => 2,
         "defaults" => array(
         "limit" => 20,
         "step" => 1,
         "order" => array(),
         "conditions" => array()
 ),
         "options" => array(
         "page" => 1,
         "limit" => 20,
         "order" => array(),
         "conditions" => array()
 )
 )
 $key    =       "tag"
 $url    =       "http://life.pennedby.me:3000";
 $step   =       1
 $escape =       true
 $model  =       null
 $tag    =       "div"

 array_merge - [internal], line ??
 PaginatorHelper::__pagingLink() -
 CORE/cake/libs/view/helpers/paginator.php, line 312
 PaginatorHelper::next() - CORE/cake/libs/view/helpers/paginator.php, line
 204
 include - APP/views/themed/clarity/posts/index.ctp, line 30
 View::_render() - CORE/cake/libs/view/view.php, line 662
 View::render() - CORE/cake/libs/view/view.php, line 376
 Controller::render() - CORE/cake/libs/controller/controller.php, line 799
 CategoriesController::view() - APP/controllers/categories_controller.php,
 line 37
 Object::dispatchMethod() - CORE/cake/libs/object.php, line 117
 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 227
 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194
 [main] - APP/webroot/index.php, line 88

 Warning (2): array_merge() [function.array-merge]: Argument #2 is not an
 array [CORE/cake/libs/view/helpers/paginator.php, line 273]

 Code | Context

 $options        =       null
 $asArray        =       true
 $model  =       null
 $paging =       array(
         "page" => 1,
         "current" => 20,
         "count" => 21,
         "prevPage" => false,
         "nextPage" => true,
         "pageCount" => 2,
         "defaults" => array(
         "limit" => 20,
         "step" => 1,
         "order" => array(),
         "conditions" => array()
 ),
         "options" => array(
         "page" => 1,
         "limit" => 20,
         "order" => array(),
         "conditions" => array()
 )
 )

 array_merge - [internal], line ??
 PaginatorHelper::url() - CORE/cake/libs/view/helpers/paginator.php, line
 273
 PaginatorHelper::link() - CORE/cake/libs/view/helpers/paginator.php, line
 256
 PaginatorHelper::__pagingLink() -
 CORE/cake/libs/view/helpers/paginator.php, line 315
 PaginatorHelper::next() - CORE/cake/libs/view/helpers/paginator.php, line
 204
 include - APP/views/themed/clarity/posts/index.ctp, line 30
 View::_render() - CORE/cake/libs/view/view.php, line 662
 View::render() - CORE/cake/libs/view/view.php, line 376
 Controller::render() - CORE/cake/libs/controller/controller.php, line 799
 CategoriesController::view() - APP/controllers/categories_controller.php,
 line 37
 Object::dispatchMethod() - CORE/cake/libs/object.php, line 117
 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 227
 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194
 [main] - APP/webroot/index.php, line 88

 Warning (2): array_merge() [function.array-merge]: Argument #2 is not an
 array [CORE/cake/libs/view/helpers/paginator.php, line 259]

 Code | Context

 $title  =       "Older >"
 $url    =       null
 $options        =       array(
         "escape" => true,
         "class" => "pagination",
         "style" => "float: right;"
 )
 $model  =       null
 $obj    =       "Html"

 array_merge - [internal], line ??
 PaginatorHelper::link() - CORE/cake/libs/view/helpers/paginator.php, line
 259
 PaginatorHelper::__pagingLink() -
 CORE/cake/libs/view/helpers/paginator.php, line 315
 PaginatorHelper::next() - CORE/cake/libs/view/helpers/paginator.php, line
 204
 include - APP/views/themed/clarity/posts/index.ctp, line 30
 View::_render() - CORE/cake/libs/view/view.php, line 662
 View::render() - CORE/cake/libs/view/view.php, line 376
 Controller::render() - CORE/cake/libs/controller/controller.php, line 799
 CategoriesController::view() - APP/controllers/categories_controller.php,
 line 37
 Object::dispatchMethod() - CORE/cake/libs/object.php, line 117
 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 227
 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194
 [main] - APP/webroot/index.php, line 88

 Warning (2): array_intersect_key() [function.array-intersect-key]:
 Argument #1 is not an array [CORE/cake/libs/view/helpers/paginator.php,
 line 260]

 Code | Context

 $title  =       "Older >"
 $url    =       null
 $options        =       array(
         "escape" => true,
         "class" => "pagination",
         "style" => "float: right;"
 )
 $model  =       null
 $obj    =       "Html"

 array_intersect_key - [internal], line ??
 PaginatorHelper::link() - CORE/cake/libs/view/helpers/paginator.php, line
 260
 PaginatorHelper::__pagingLink() -
 CORE/cake/libs/view/helpers/paginator.php, line 315
 PaginatorHelper::next() - CORE/cake/libs/view/helpers/paginator.php, line
 204
 include - APP/views/themed/clarity/posts/index.ctp, line 30
 View::_render() - CORE/cake/libs/view/view.php, line 662
 View::render() - CORE/cake/libs/view/view.php, line 376
 Controller::render() - CORE/cake/libs/controller/controller.php, line 799
 CategoriesController::view() - APP/controllers/categories_controller.php,
 line 37
 Object::dispatchMethod() - CORE/cake/libs/object.php, line 117
 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 227
 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194
 [main] - APP/webroot/index.php, line 88

 Warning (2): array_merge() [function.array-merge]: Argument #1 is not an
 array [CORE/cake/libs/view/helpers/paginator.php, line 260]

 Code | Context

 $title  =       "Older >"
 $url    =       null
 $options        =       array(
         "escape" => true,
         "class" => "pagination",
         "style" => "float: right;"
 )
 $model  =       null
 $obj    =       "Html"

 array_merge - [internal], line ??
 PaginatorHelper::link() - CORE/cake/libs/view/helpers/paginator.php, line
 260
 PaginatorHelper::__pagingLink() -
 CORE/cake/libs/view/helpers/paginator.php, line 315
 PaginatorHelper::next() - CORE/cake/libs/view/helpers/paginator.php, line
 204
 include - APP/views/themed/clarity/posts/index.ctp, line 30
 View::_render() - CORE/cake/libs/view/view.php, line 662
 View::render() - CORE/cake/libs/view/view.php, line 376
 Controller::render() - CORE/cake/libs/controller/controller.php, line 799
 CategoriesController::view() - APP/controllers/categories_controller.php,
 line 37
 Object::dispatchMethod() - CORE/cake/libs/object.php, line 117
 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 227
 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194
 [main] - APP/webroot/index.php, line 88

 Warning (2): array_merge() [function.array-merge]: Argument #2 is not an
 array [CORE/cake/libs/view/helpers/paginator.php, line 260]

 Code | Context

 $title  =       "Older >"
 $url    =       null
 $options        =       array(
         "escape" => true,
         "class" => "pagination",
         "style" => "float: right;"
 )
 $model  =       null
 $obj    =       "Html"

 array_merge - [internal], line ??
 PaginatorHelper::link() - CORE/cake/libs/view/helpers/paginator.php, line
 260
 PaginatorHelper::__pagingLink() -
 CORE/cake/libs/view/helpers/paginator.php, line 315
 PaginatorHelper::next() - CORE/cake/libs/view/helpers/paginator.php, line
 204
 include - APP/views/themed/clarity/posts/index.ctp, line 30
 View::_render() - CORE/cake/libs/view/view.php, line 662
 View::render() - CORE/cake/libs/view/view.php, line 376
 Controller::render() - CORE/cake/libs/controller/controller.php, line 799
 CategoriesController::view() - APP/controllers/categories_controller.php,
 line 37
 Object::dispatchMethod() - CORE/cake/libs/object.php, line 117
 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 227
 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194
 [main] - APP/webroot/index.php, line 88
 }}}
 [[BR]]
 [[BR]]
 [[BR]]
 What I Suggest:
 [[BR]]
 [[BR]]
 Changing line 320 of the paginator helper to check if the URL is an array.
 If it is, use line 320, if it is not, append the page named parameter to
 the end.

-- 
Ticket URL: <https://trac.cakephp.org/ticket/6288>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design 
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. 
Our primary goal is to provide a structured framework that enables PHP users at 
all levels to rapidly develop robust web applications, without any loss to 
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tickets cakephp" group.
To post to this group, send email to tickets-cakephp@googlegroups.com
To unsubscribe from this group, send email to 
tickets-cakephp+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---

  • [CakePHP : The Rapid Dev... CakePHP : The Rapid Development Framework for PHP

Reply via email to