Ergebnis 1 bis 11 von 11

Thema: Nach Update auf 2.10 JSON Fehlermeldung und PHP Warning (function.rename)

  1. #1
    Contao-Nutzer
    Registriert seit
    21.01.2010.
    Beiträge
    30

    Standard Nach Update auf 2.10 JSON Fehlermeldung und PHP Warning (function.rename)

    Hallo zusammen,

    ich habe eben auf die 2.10 geupdated und bekomme jetzt beim Aufklappen der Seitenstruktur folgenden JSON Fehler:
    SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data

    Zudem habe ich am Seitenende zusätzlich folgende PHP Fehlermeldung bzw Warning:
    Warning: rename(D:\ablage\Websites\Contao/system/tmp/386bacfc1f8556f37947f7cf0a933a33,D:\ablage\Website s\Contao/system/tmp/bc2b06d0d6aef24c1d8441404a74cef4.txt) [function.rename]: File exists in D:\ablage\Websites\Contao\system\libraries\FileCac he.php on line 118

    #0 [internal function]: __error(2, 'rename(D:\ablag...', 'D:\ablage\Websi...', 118, Array)
    #1 D:\ablage\Websites\Contao\system\libraries\FileCac he.php(118): rename('D:\ablage\Websi...', 'D:\ablage\Websi...')
    #2 [internal function]: FileCache->__destruct()
    #3 {main}


    Die Datenbankupdates sind alle sauber durchgelaufen und auch sonst hats während des Updates keine Anzeichen für Schwierigkeiten gegeben.

    Ich habe in der Systemwartung schon die Datenbereinigung ausgeführt.
    Habe ich etwas übersehen?

  2. #2
    Contao-Yoda Avatar von MacKP
    Registriert seit
    15.06.2009.
    Ort
    Duisburg
    Beiträge
    13.292
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Hallo EternaX,
    ich glaub das könnte weiter helfen: http://www.contao-community.org/view...=unread#unread

    Viele Grüße
    Contao Pool | C-C-A | MetaModels | [Internetseite -> Mediendepot Ruhr]
    [Arbeitet bei -> Paus Design & Medien]
    "I can EXPLAIN it to you, but I can't UNDERSTAND it for you."

  3. #3
    Maintainer Avatar von xtra
    Registriert seit
    02.07.2009.
    Ort
    Tuebingen
    Beiträge
    2.007
    User beschenken
    Wunschliste

    Standard

    Vermutlich eher: http://dev.contao.org/issues/3390 da es sich um einen Windows server handelt.
    Bedenke stets: Wenn Du ungenaue oder unzureichende Angaben machst, so koennte dies die Bearbeitung deiner Frage endlos verzoegern (oder sogar dazu fyhren, dass ich zu viel nachdenken muss und die Antwort vergesse!). Kein Support per PN.

  4. #4
    Contao-Nutzer Avatar von HAST
    Registriert seit
    09.07.2010.
    Ort
    Austria
    Beiträge
    165

    Standard Syntaxerror: JSON.parse: unexpected character

    hallo

    ich habe dies
    Code:
    Syntaxerror: JSON.parse: unexpected character
    ScreenShot006.png

    "es" auch kam eigentlich ohne grund und ohne update. ist eine neuinstallation die bereits funktionierte und eigentlich schon ready ist (www.glaserei-gueney.at)aber
    mit euren anleitungen komm ich leider nicht klar.
    die zeile in filetree.php hab ich laut anleitung geändert bringt auch nichts und server hab ich keinen. bin bei world4you mit einer php 5.3.

    frontend kommt nichts fehlermeldung einschalten zeigt nichts an, contao-check.oho ohne fehler.........
    herzlichen und lieben gruss
    hast

  5. #5
    Contao-Urgestein Avatar von do_while
    Registriert seit
    15.06.2009.
    Ort
    Berlin | Deutschland
    Beiträge
    3.614
    Partner-ID
    1081
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Hier die gefundene Lösung für alle Interessiere:

    Es gab eine php-Datei, die mit BOM gespeichert war. Auf manchen Servern bekommt man eine Fehlermeldung, hier war das nicht so, dafür entgleisen diverse Funktionen und das Layout vorwiegend im Internet-Explorer.

    Mit dem BOM-Finder lassen sich die Dateien aufspüren, die man dann lädt und ohne BOM wieder abspeichert.

    Weitere Infos dazu:
    http://de.contaowiki.org/UTF-8_ohne_BOM
    http://www.contao.org/erweiterungsli...hecker.de.html

  6. #6
    Contao-Nutzer
    Registriert seit
    20.09.2011.
    Beiträge
    2

    Standard Kleiner Hack

    Hallo,

    unter folgedem Link gibt's ein ähnliches Problem:
    contao-community - .tpl-oder-.html5

    Unter:
    dev.contao - Ticket 3390
    habe ich eine (zweite) mögliche Lösung für Win vorgeschlagen.

    Vielleicht funktioniert die ja auch bei euch.

    @do_while
    Danke für diesen Hinweis und die Extension. Das war mir neu.

    Grüße
    fernIgel

  7. #7
    Contao-Nutzer
    Registriert seit
    16.07.2009.
    Ort
    Schweiz
    Beiträge
    202

    Standard

    Zitat Zitat von xtra Beitrag anzeigen
    Vermutlich eher: http://dev.contao.org/issues/3390 da es sich um einen Windows server handelt.
    Hi,
    Ich habe FileCache für den Windows Server (Hoster), so angepasst. Nun bekomme ich aber folgende Meldung wenn ich installieren will.

    Fatal error: Call to undefined function rename_win() in C:\inetpub\vhosts\rhquality.ch\httpdocs\cms\system \libraries\FileCache.php on line 129

    Die Funktion habe ich zusätzlich als Public definiert aber auch ohne dies kommt die gleiche Meldung und ich kann mit der Installation nicht weitermachen.

    Code:
    <?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
    
    /**
     * Contao Open Source CMS
     * Copyright (C) 2005-2011 Leo Feyer
     *
     * Formerly known as TYPOlight Open Source CMS.
     *
     * This program is free software: you can redistribute it and/or
     * modify it under the terms of the GNU Lesser General Public
     * License as published by the Free Software Foundation, either
     * version 3 of the License, or (at your option) any later version.
     * 
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
     * Lesser General Public License for more details.
     * 
     * You should have received a copy of the GNU Lesser General Public
     * License along with this program. If not, please visit the Free
     * Software Foundation website at <http://www.gnu.org/licenses/>.
     *
     * PHP version 5
     * @copyright  Leo Feyer 2005-2011
     * @author     Leo Feyer <http://www.contao.org>
     * @package    System
     * @license    LGPL
     * @filesource
     */
    
    
    /**
     * Class FileCache
     *
     * Provide methods to create a file cache.
     * @copyright  Leo Feyer 2011
     * @author     Leo Feyer <http://www.contao.org>
     * @package    Library
     */
    class FileCache extends System
    {
    
    	/**
    	 * Current object instances (Singleton)
    	 * @var object
    	 */
    	protected static $arrInstances = array();
    
    	/**
    	 * Cache file name
    	 * @var string
    	 */
    	protected $strFile;
    
    	/**
    	 * Indicates whether the cache has been modified
    	 * @var boolean
    	 */
    	protected $blnIsModified = false;
    
    
    	/**
    	 * Try to load the cache file
    	 * @param string
    	 */
    	protected function __construct($strFile)
    	{
    		$this->strFile = md5($strFile) . '.txt';
    		$strPath = TL_ROOT . '/system/tmp/' . $this->strFile;
    
    		// Read the file content if it exists
    		if (file_exists($strPath))
    		{
    			$strBuffer = file_get_contents($strPath);
    			$arrCache = deserialize($strBuffer);
    
    			if (is_array($arrCache))
    			{
    				$this->arrCache = $arrCache;
    			}
    		}
    	}
    
    
    	/**
    	 * Store the cache file
    	 * 
    	 * We can write directly to the system/tmp folder, because it will be set
    	 * to CHMOD 777 during installation in case the Safe Mode Hack is required.
    	 */
             public function rename_win($oldfile,$newfile) {
             if (!rename($oldfile,$newfile)) {
             if (copy ($oldfile,$newfile)) {
             unlink($oldfile);
             return TRUE;
             }
             return FALSE;
             }
             return TRUE;
            }
    	public function __destruct()
    	{
    		// Return if the cache has not been modified
    		if (!$this->blnIsModified)
    		{
    			return;
    		}
    
    		$strPath = TL_ROOT . '/system/tmp';
    
    		// Return if the tmp folder is not writeable. This is typically
    		// the case when Contao is installed the first time and the Safe
    		// Mode Hack has not yet been configured.
    		if (!is_writable(TL_ROOT . '/system/tmp'))
    		{
    			return;
    		}
    
    		ksort($this->arrCache);
    		$strTemp = md5(uniqid(mt_rand(), true));
    
    		// Write to a temp file first
    		$fh = fopen($strPath . '/' . $strTemp, 'wb');
    		fputs($fh, serialize($this->arrCache));
    		fclose($fh);
    
    		// Then move the file to its final destination
    		//rename($strPath . '/' . $strTemp, $strPath . '/' . $this->strFile)		  
                    rename_win($strPath . '/' . $strTemp, $strPath . '/' . $this->strFile);
    
    	}
    
    	/**
    	 * Check whether a variable is set
    	 * @param string
    	 * @return boolean
    	 */
    	public function __isset($strKey)
    	{
    		return isset($this->arrCache[$strKey]);
    	}
    
    
    	/**
    	 * Return a variable
    	 * @param string
    	 * @return mixed
    	 */
    	public function __get($strKey)
    	{
    		return $this->arrCache[$strKey];
    	}
    
    
    	/**
    	 * Set a variable
    	 * @param string
    	 * @param mixed
    	 */
    	public function __set($strKey, $varValue)
    	{
    		$this->blnIsModified = true;
    		$this->arrCache[$strKey] = $varValue;
    	}
    
    
    	/**
    	 * Unset an entry
    	 * @param string
    	 */
    	public function __unset($strKey)
    	{
    		$this->blnIsModified = true;
    		unset($this->arrCache[$strKey]);
    	}
    
    
    	/**
    	 * Instantiate a new file cache object and return it (Factory)
    	 * @param string
    	 * @return object
    	 */
    	public static function getInstance($strFile)
    	{
    		if (!isset(self::$arrInstances[$strFile]))
    		{
    			self::$arrInstances[$strFile] = new self($strFile);
    		}
    
    		return self::$arrInstances[$strFile];
    	}
    }
    
    ?>

  8. #8
    Maintainer Avatar von xtra
    Registriert seit
    02.07.2009.
    Ort
    Tuebingen
    Beiträge
    2.007
    User beschenken
    Wunschliste

    Standard

    Zitat Zitat von iku Beitrag anzeigen
    Die Funktion habe ich zusätzlich als Public definiert aber auch ohne dies kommt die gleiche Meldung und ich kann mit der Installation nicht weitermachen.
    Du hast aus der Funktion somit jedoch eine Methode gemacht.
    Schieb die Funktion doch einfach ueber die Klasse und es sollte (hoffentlich) passen.

    Ist jedoch ein Hotfix und nicht updatesafe und es gibt sicher auch noch eleganteres.
    Bedenke stets: Wenn Du ungenaue oder unzureichende Angaben machst, so koennte dies die Bearbeitung deiner Frage endlos verzoegern (oder sogar dazu fyhren, dass ich zu viel nachdenken muss und die Antwort vergesse!). Kein Support per PN.

  9. #9
    Contao-Nutzer
    Registriert seit
    16.07.2009.
    Ort
    Schweiz
    Beiträge
    202

    Standard

    So jetzt bin ich ein Schritt weiter.

    Hat geklappt:

    Code:
    <?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
    
    /**
     * Contao Open Source CMS
     * Copyright (C) 2005-2011 Leo Feyer
     *
     * Formerly known as TYPOlight Open Source CMS.
     *
     * This program is free software: you can redistribute it and/or
     * modify it under the terms of the GNU Lesser General Public
     * License as published by the Free Software Foundation, either
     * version 3 of the License, or (at your option) any later version.
     * 
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
     * Lesser General Public License for more details.
     * 
     * You should have received a copy of the GNU Lesser General Public
     * License along with this program. If not, please visit the Free
     * Software Foundation website at <http://www.gnu.org/licenses/>.
     *
     * PHP version 5
     * @copyright  Leo Feyer 2005-2011
     * @author     Leo Feyer <http://www.contao.org>
     * @package    System
     * @license    LGPL
     * @filesource
     */
    
    
    /**
     * Class FileCache
     *
     * Provide methods to create a file cache.
     * @copyright  Leo Feyer 2011
     * @author     Leo Feyer <http://www.contao.org>
     * @package    Library
     */
     
    //Windows Server Fix Installation, Funktion rename PHP Verhalten
    function rename_win($oldfile,$newfile)
    	 {
              if (!rename($oldfile,$newfile))
    		{
    			if (copy ($oldfile,$newfile))
    			{ unlink($oldfile);
    			  return TRUE;
                   }
    			return FALSE;
             }
    		
    		return TRUE;
             } 
     
    class FileCache extends System
    {
    
    	/**
    	 * Current object instances (Singleton)
    	 * @var object
    	 */
    	protected static $arrInstances = array();
    
    	/**
    	 * Cache file name
    	 * @var string
    	 */
    	protected $strFile;
    
    	/**
    	 * Indicates whether the cache has been modified
    	 * @var boolean
    	 */
    	protected $blnIsModified = false;
    
    
    	/**
    	 * Try to load the cache file
    	 * @param string
    	 */
    	protected function __construct($strFile)
    	{
    		$this->strFile = md5($strFile) . '.txt';
    		$strPath = TL_ROOT . '/system/tmp/' . $this->strFile;
    
    		// Read the file content if it exists
    		if (file_exists($strPath))
    		{
    			$strBuffer = file_get_contents($strPath);
    			$arrCache = deserialize($strBuffer);
    
    			if (is_array($arrCache))
    			{
    				$this->arrCache = $arrCache;
    			}
    		}
    	}
    
    
    	/**
    	 * Store the cache file
    	 * 
    	 * We can write directly to the system/tmp folder, because it will be set
    	 * to CHMOD 777 during installation in case the Safe Mode Hack is required.
    	 */
             
    	
    	public function __destruct()
    	{
    		// Return if the cache has not been modified
    		if (!$this->blnIsModified)
    		{
    			return;
    		}
    
    		$strPath = TL_ROOT . '/system/tmp';
    
    		// Return if the tmp folder is not writeable. This is typically
    		// the case when Contao is installed the first time and the Safe
    		// Mode Hack has not yet been configured.
    		if (!is_writable(TL_ROOT . '/system/tmp'))
    		{
    			return;
    		}
    
    		ksort($this->arrCache);
    		$strTemp = md5(uniqid(mt_rand(), true));
    
    		// Write to a temp file first
    		$fh = fopen($strPath . '/' . $strTemp, 'wb');
    		fputs($fh, serialize($this->arrCache));
    		fclose($fh);
    
    	    // Then move the file to its final destination
    	    //rename($strPath . '/' . $strTemp, $strPath . '/' . $this->strFile)		  
                rename_win($strPath . '/' . $strTemp, $strPath . '/' . $this->strFile);
    
    	}
    
    	/**
    	 * Check whether a variable is set
    	 * @param string
    	 * @return boolean
    	 */
    	public function __isset($strKey)
    	{
    		return isset($this->arrCache[$strKey]);
    	}
    
    
    	/**
    	 * Return a variable
    	 * @param string
    	 * @return mixed
    	 */
    	public function __get($strKey)
    	{
    		return $this->arrCache[$strKey];
    	}
    
    
    	/**
    	 * Set a variable
    	 * @param string
    	 * @param mixed
    	 */
    	public function __set($strKey, $varValue)
    	{
    		$this->blnIsModified = true;
    		$this->arrCache[$strKey] = $varValue;
    	}
    
    
    	/**
    	 * Unset an entry
    	 * @param string
    	 */
    	public function __unset($strKey)
    	{
    		$this->blnIsModified = true;
    		unset($this->arrCache[$strKey]);
    	}
    
    
    	/**
    	 * Instantiate a new file cache object and return it (Factory)
    	 * @param string
    	 * @return object
    	 */
    	public static function getInstance($strFile)
    	{
    		if (!isset(self::$arrInstances[$strFile]))
    		{
    			self::$arrInstances[$strFile] = new self($strFile);
    		}
    
    		return self::$arrInstances[$strFile];
    	}
    }
    
    ?>
    Leider kann ich nach Lizenz akzeptieren aber nicht weitermachen? WTF...now? mmhhh grübbel?

    Ein Tip?

  10. #10
    Contao-Nutzer
    Registriert seit
    16.07.2009.
    Ort
    Schweiz
    Beiträge
    202

    Standard

    Diese Windows Büchse stellt sich quer....

  11. #11
    Alter Contao-Hase
    Registriert seit
    22.06.2009.
    Ort
    Köln
    Beiträge
    1.342

    Standard

    Hallo,

    ich bin gerade beim Newsletterversand von Avisota (Contao 2.10.3 und aktuelle Avisota) und bekomme auch den Fehler !

    Code:
    SyntaxError: JSON.parse: unexpected character
    Im system-Log steht bei vielen Adressen:
    Recipient address "xxx@yyy.de" was rejected and has been deactivated

    Es sind bereits 150 Newsletter raus und dann gehts nicht weiter... Es müssen aber noch 980 raus!

    Was kann ich machen????

    Grüße
    Matu
    Geändert von matuweb (06.01.2012 um 07:51 Uhr)
    Viele Grüße aus Köln
    Matu

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Lesezeichen

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •