Fatal error: Only variables can be passed by reference in...

General discussions about WebYep
Post Reply
wuhoo
Posts: 6
Joined: Mon Oct 19, 2009 8:28 pm

Fatal error: Only variables can be passed by reference in...

Post by wuhoo » Thu May 27, 2010 3:02 am

Hi, I have just come across an error in WepYep (1.4.6) reported by a client where after I created a few new site pages with WY elements and the client logs-in to edit, everything on the page displays until the first instance of a WY element. Then all code following what should be the first instance disappears and the site page looks incomplete. After I activated the debug mode, this is the error that is returned:

Fatal error: Only variables can be passed by reference in /netapp/whnas-silo1-node2/s1/s1/00205/www.equalaccess.org/webdocs/webyep-system/program/lib/WYDocument.php on line 131

Line 131 of WYDocument.php as referenced in the error is the following:

Code: Select all

$oF =& new WYFile($this->oDocumentsFilePath());


And here is the code in content:

Code: Select all

   function iAddPageIDForDocumentPath($oP, $iNewID)
   {
      global $goApp;

      $oF =& new WYFile($this->oDocumentsFilePath());
      $sFileContent = "\r\n" . $oP->sPath . "\t" . $iNewID;
      if (!$oF->bAppend($sFileContent)) {
         $sFileContent = $oF->sContent() . $sFileContent;
         $oF->setContent($sFileContent);
         if (!$oF->bWrite()) {
            $goApp->log("could not store new page iD " . $iNewID);
            $iNewID = 0;
         }
      }
      @$oF->chmod(0644);
      return $iNewID;
   }


My process for new site pages of a specific layout template is to duplicate an existing template page locally and manually edit the WY elements to give them different names/labels and upload the file. I upload, provide the links to the client to go to the page directly and then they log-in (which is on all the pages) and click on the edit icons to enter content. We have never encountered a problem with this and everything has displayed correctly before.

All existing pages that already have WY content filled in display correctly and no errors are reported. Any thoughts on this?

johannes
Objective Development
Objective Development
Posts: 815
Joined: Fri Nov 10, 2006 4:39 pm
Contact:

Re: Fatal error: Only variables can be passed by reference in...

Post by johannes » Mon May 31, 2010 6:09 pm

Your server uses PHP 5.0.5.

The system requirements of WebYep state a minimum version of 5.1 (for the PHP 5 branch) - please try to update (or make your ISP update) the PHP engine to a more recent one.

wuhoo
Posts: 6
Joined: Mon Oct 19, 2009 8:28 pm

Re: Fatal error: Only variables can be passed by reference in...

Post by wuhoo » Wed Jun 02, 2010 9:22 pm

Thanks for the reply Johannes. i contacted the client's host provider and unfortunately, they will not be updating the php until the end of the year. I realized after I made my original post, that the only change I made to the system was to upgrade to WebYep 1.4.6. We didn't encounter the problem right away because the client hadn't requested to add new pages yet.

So the only option I have for now is to downgrade the WebYep to a previous version that still works with php 5.0.5 (what is the latest version of WebYep that still supports it). Will this downgrade cause any problems since I already updated to WebYep 1.4.6?

Thanks,
Frank

johannes wrote:Your server uses PHP 5.0.5.

The system requirements of WebYep state a minimum version of 5.1 (for the PHP 5 branch) - please try to update (or make your ISP update) the PHP engine to a more recent one.

johannes
Objective Development
Objective Development
Posts: 815
Joined: Fri Nov 10, 2006 4:39 pm
Contact:

Re: Fatal error: Only variables can be passed by reference in...

Post by johannes » Wed Jun 02, 2010 9:34 pm

That depends on which new features of 1.4.6 you already used and which version you want to downgrade to.

wuhoo
Posts: 6
Joined: Mon Oct 19, 2009 8:28 pm

Re: Fatal error: Only variables can be passed by reference in...

Post by wuhoo » Wed Jun 02, 2010 10:39 pm

I don't believe I was using any new feature specific to 1.4.6. What is the latest version of WebYep that still supports php 5.0.5? The ObDev website only shows the latest 1.4.6 requirements and the release notes don't mention the requirements.

Thanks,
Frank

johannes wrote:That depends on which new features of 1.4.6 you already used and which version you want to downgrade to.

johannes
Objective Development
Objective Development
Posts: 815
Joined: Fri Nov 10, 2006 4:39 pm
Contact:

Re: Fatal error: Only variables can be passed by reference in...

Post by johannes » Wed Jun 02, 2010 11:14 pm

Unfortunately there was no version of WebYep that intentionally supported PHP 5.0.5.

There might be a version that did run on 5.0.5 - but I cannot say which, as WebYep was never tested with 5.0.5.

I assume you do not know which version was installed on that server before the upgrade... :wink:

After WebYep 1.4.2 the respective code part was changed to the way it is now - so you might want to try 1.4.2.

wuhoo
Posts: 6
Joined: Mon Oct 19, 2009 8:28 pm

Re: Fatal error: Only variables can be passed by reference in...

Post by wuhoo » Thu Jun 03, 2010 2:25 am

I was able to find out that the previous version of WebYep used was 1.3.0 from ages ago! But I will try 1.4.2 to see if that might work first. If not, then it's back to 1.3 we go... I will report back here what ends up working if I am successful.

Thanks for your help!
Frank

johannes wrote:Unfortunately there was no version of WebYep that intentionally supported PHP 5.0.5.

There might be a version that did run on 5.0.5 - but I cannot say which, as WebYep was never tested with 5.0.5.

I assume you do not know which version was installed on that server before the upgrade... :wink:

After WebYep 1.4.2 the respective code part was changed to the way it is now - so you might want to try 1.4.2.

wuhoo
Posts: 6
Joined: Mon Oct 19, 2009 8:28 pm

Re: Fatal error: Only variables can be passed by reference in...

Post by wuhoo » Thu Jun 03, 2010 3:46 am

Johannes,

Thanks for the suggestion to use WY 1.4.2, it worked! At least for the time being until the host providers upgrade php later in the year, my client can continue with this.

Cheers,
Frank

Post Reply