2

我在名为 Readless 的 joomla 插件上收到此错误:

Fatal error: Call to undefined method JDate::toFormat() in D:\wamp\www\test\plugins\content\readlesstext\readlesstext.php on line 1371
Call Stack
#   Time    Memory  Function    Location
1   0.0007  340432  {main}( )   ..\index.php:0
2   0.1884  7087984 JSite->dispatch( )  ..\index.php:52
3   0.1919  7150720 JComponentHelper::renderComponent( )    ..\application.php:205
4   0.1986  7192016 JComponentHelper::executeComponent( )   ..\helper.php:339
5   0.1990  7239144 require_once( 'D:\wamp\www\test\components\com_content\content.php' )   ..\helper.php:359
6   0.2060  7681608 JControllerLegacy->execute( )   ..\content.php:16
7   0.2060  7681656 ContentController->display( )   ..\legacy.php:722
8   0.2061  7683608 JControllerLegacy->display( )   ..\controller.php:77
9   0.2169  8470112 ContentViewCategory->display( ) ..\legacy.php:685
10  0.3341  10557472    JEventDispatcher->trigger( )    ..\view.html.php:109
11  0.3341  10558024    JEvent->update( )   ..\dispatcher.php:161
12  0.3341  10558528    call_user_func_array ( )    ..\event.php:71
13  0.3341  10558552    plgContentReadLessText->onContentBeforeDisplay( )   ..\event.php:0
14  0.3341  10558640    plgContentReadLessText->ReadLessText( ) ..\readlesstext.php:1448
15  0.3676  10562608    plgContentReadLessText->_GetParams( )   ..\readlesstext.php:1549
16  0.3836  10586160    ReadLessTextExpand->SetExpandables( )   ..\readlesstext.php:1871

这是插件文件中的代码:

   if ( $dateFormat )
    {
      if ( $this->_created )
      {
        $this->_expandables[ '{created}' ] = $this->_created->toFormat( $dateFormat );
      }
      if ( $this->_modified )
      {
        $this->_expandables[ '{modified}' ] = $this->_modified->toFormat( $dateFormat );
      }
      if ( $this->_publishUp )
      {
        $this->_expandables[ '{publish_up}' ] = $this->_publishUp->toFormat( $dateFormat );
      }
    }

我没看出有什么问题,帮帮我。它的

4

1 回答 1

6

得到了答案:

toFormat

在 joomla 3 中已弃用

采用 Format

于 2012-12-09T13:30:42.230 回答