Skip to content

Fatal error: Call to a member function getFileReferences() on a non-object in … /typo3/sysext/core/Classes/Resource/Service/FrontendContentAdapterService.php on line 90

PROBLEM
PHP Error:
Fatal error: Call to a member function getFileReferences() on a non-object in … /typo3/sysext/core/Classes/Resource/Service/FrontendContentAdapterService.php on line 90

CAUSE
This is where the fatal php error occurs
Why? Because self::getPageRepository() returns null instead of an object when content elements with images are involved (and EXT:speciality, EXT:fluidcontent, EXT:flux is used)

$files = self::getPageRepository()->getFileReferences($table, $migrateFieldName, $row);

SOLUTION/WORKAROUND
Replace above line with these lines

$dvsPageRepositoryObj = self::getPageRepository(); 

if ($dvsPageRepositoryObj) {
   $files = $dvsPageRepositoryObj->getFileReferences($table, $migrateFieldName, $row);
} else {
   // If $dvsPageRepositoryObj is null (e.g. not an object) return an empty array
   $files = array();
}

ENVIRONMENT
Typo3 6.2.12 + EXT:speciality (fluidcontent_core, vhs, …)
PHP 5.5.18
Mac OS X Yosemite

Advertisements

Uncached FLUID viewhelper

PROBLEM
Make parts of your typo3 fluid template uncached. E.g. disable the cache for them, without using “no_cache” or USER_INT or COA_INT.
Why? To display different FLUID templates for mobile and desktop clients. Or simply to display the current time on the website.

CAUSE
The fluid template engine offers no native command to uncache partials.

SOLUTION
Install this Extension: “vhs”
Get it here: http://typo3.org/extensions/repository/view/vhs

It provides a viewhelper called “render.uncache”, that allows uncaching of partial.
See https://fluidtypo3.org/viewhelpers/vhs/2.1.4/Render/UncacheViewHelper.html for more information.

USAGE

 <v:render.uncache section="MySection" partial="MyPartial" arguments="{_all}"/>

RELATED
http://lists.typo3.org/pipermail/typo3-project-typo3v4mvc/2012-September/012878.html
http://typo3.3.n7.nabble.com/Do-not-cache-part-of-Fluid-template-How-to-td251880.html

2013 in review

The WordPress.com stats helper monkeys prepared a 2013 annual report for this blog.

Here’s an excerpt:

A New York City subway train holds 1,200 people. This blog was viewed about 6,700 times in 2013. If it were a NYC subway train, it would take about 6 trips to carry that many people.

Click here to see the complete report.

Fatal error: Cannot redeclare class OAuthException

Solution

/immocaster/Oauth/OAuth.php

<?php
    /* Generic exception class
     */

    // schmelzer, 24. Feb. 2014
    // Enclosed class definition by if()
    // To avoid PHP Error. Tested with PHP 5.3/liip.ch
    // --
    // http://wordpress.org/support/topic/fatal-error-cannot-redeclare-class-oauthexception
    // Related to
    // https://github.com/abraham/twitteroauth/blob/master/twitteroauth/OAuth.php

    if (!class_exists('OAuthException')) {
        class OAuthException extends Exception {

            // pass
        }

    }

STRATO – Filesize limit 30 MB

Provider:
strato.de

Package:
-PowerPlus L

Unexpected Behaviour:
-Filesize limit 30 MB

Details
-You cannot create files larger than 30 MB on the server.
-I ran into this, when the backup of a website with tar didn’t work.
-The size of the created tar archive should be 70 MB.
-This is not about upload limits of php

Related Post (german)
http://www.tutorials.de/php/391948-zip-datei-splitten.html#post2026103

Applesscript in the shell! Cool!

Use applescript in the shell, to open a folder in finder

osascript  -e 'tell application "Finder"'  -e reopen -e 'set target of Finder window 1 to POSIX file ("/Users")'  -e activate   -e end

Plaintext passwords in /Library/Caches/Metadata/DEVONthink

Situation

I use DevonThink Office Pro (DTOP) to store sensitive information, like useraccounts and passwords in plain text files.
To secure my DTOP-Database, I store it on an encrypted, password protected volume as described here:
http://forum.devontechnologies.com/viewtopic.php?f=4&t=6519#p30201

020 - Encrypted and passwordprotected volume

Problem

The information from my plain text files show up in
/Users/myUserName/Library/Caches/Metadata/DEVONthink Pro 2/…

100 - test2 DB

200 - Cache Dir

220 - Mac OS X - Cache File

Cause

According to this post:
http://forum.devontechnologies.com/viewtopic.php?f=2&t=6630#p30158
This folder is needed if you want to use Spotlight to search your DEVON database(s).

Solution #1

According to the same post:
http://forum.devontechnologies.com/viewtopic.php?f=2&t=6630#p30158
If you don’t want this, go to the File > Database Properties and untick the Create Spotlight Index.
If you do want it, you may want to move that folder to the Trash and use the aforementioned panel to Rebuild the index. That will guarantee that the Rebuild starts from a fresh slate.

Solution #2

I could encrypt the plaintext file with a GPG Program outside of DTPO.

Test environment

900 - Test Environment - OS X 10.8.3 - Mountain Lion, DTPO 2.5.2

Links

http://forum.devontechnologies.com/viewtopic.php?f=2&t=17228