user2310852
user2310852

Reputation: 1674

piBased Plugin (FLUID) - Image Problems with TYPO3 6.2

I still use piBased-Plugins in my updated TYPO3 v6.2.7 - Installation. Since 6.2., I have some problems with my small Frontend-Plugin.

My Plugin only show a headline, link and an image. If there is no Image selected in Backend, my plugin doesn't show the HTML-Output in Frontend:

<f:if condition="{imgTeaser}">
  <f:image src="{imgTeaser}" alt="" />
</f:if>

But now I get an error. If I upload an image everything was fine. But without an image, i 'll get these Error warnings in Backend and Frontend.

HOW CAN I UPDATE MY piBASED-PLUGIN (FLEXFORM)? There must be a problem with the images or path-to-image. I'm not a PHP-Programmer, so I have no idea .. ;)

"Supplied file object type TYPO3\CMS\Core\Resource\Folder must be File or FileReference."

Thanks for your help! Stef

--

Deprication Log:

|The way registering a wizard in TCA has changed in 6.2. Please set module[name]=module_name instead of using script=path/to/sctipt.php in your TCA. The possibility to register wizards this way will be removed in 2 versions.|

Frontend Error:

Supplied file object type TYPO3\CMS\Core\Resource\Folder must be File or FileReference.

and

09-12-14 10:56:

|TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA() - since 6.1, will be removed two versions later - require(typo3/sysext/cms/tslib/index_ts.php),index.php#28 // TYPO3\CMS\Core\Core\Bootstrap->loadExtensionTables#123 // TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtTables#925 // TYPO3\CMS\Core\Cache\Frontend\PhpFrontend->requireOnce#1729 // TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend->requireOnce#72 // require_once(typo3temp/Cache/Code/cache_core/ext_tables_8daea175f152090331d107ba834640863df1679e.php),typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php#364 // TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA#3183 // TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction#4167 (typo3/sysext/core/Classes/Utility/GeneralUtility.php#4165)|

I use a flexform to upload my images from the Plugin to the /uploads-Folder like this:

<image>
    <TCEforms>
        <label>LLL:EXT:my_modules/pi3/locallang_flex.xml:label.imgTeaser</label>
        <config>
            <type>group</type>
            <internal_type>file</internal_type>
            <allowed>jpg,png,gif</allowed>
            <max_size>500000</max_size>
            <uploadfolder>uploads/tx_mymodules/</uploadfolder>
            <size>1</size>
            <maxitems>1</maxitems>
            <minitems>0</minitems>
            <show_thumbs>1</show_thumbs>
        </config>
    </TCEforms>
</image>

PHP-class:

class tx_mymodules_pi3 extends tslib_pibase {
  ...
  var $imagePath = 'uploads/tx_mymodules/';
  ...
  public function main($content, array $conf) {
    $image = $this-> imagePath . $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'image', 'basicsheet');
  ...
    $this->view->assign('imgTeaser', $image);
  ...
    return ($content);
  }
}

Upvotes: 0

Views: 812

Answers (1)

user2310852
user2310852

Reputation: 1674

my FLUID Template was wrong. But I don't know why?!

Was:

<f:if condition="{imgTeaser}">
  <f:image src="{imgTeaser}" alt="" />
</f:if>

Now:

<f:if condition="{imgTeaser}">
  <f:image src="uploads/tx_mymodules/{imgTeaser}" alt="" />
</f:if>

And in my PHP CLass:

var $imagePath = 'uploads/tx_mymodules/';

public function main($content, array $conf) {
  ...
  $image = $this-> imagePath . $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'image', 'basicsheet');
  ...
}

Change To:

public function main($content, array $conf) {
  ...
  $image = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'image', 'basicsheet');
  ...
}

Now it works! Maybe someone can explain it ... Thx

Upvotes: 0

Related Questions