Typo3 9.5.11. Расширение tx_news с пользовательскими полями. Иногда содержимое исчезает? - PullRequest
0 голосов
/ 21 ноября 2019

Я столкнулся с той же проблемой, что и исчезнувший контент при расширении расширения tx_news. Я расширяю расширение новостей некоторыми чекбоксами, но эти значения теряются через некоторое время (2 часа). Если я очищаю системный кеш, значение флажка снова верное, но через некоторое время оно снова исчезает. У меня была эта проблема с версией 9.5.5, но с моей точки зрения я все сделал правильно. Почему контент иногда пропадает?

/**
* News model for default news
*
* @package TYPO3
* @subpackage tx_news
*/
class NewsExtend extends \GeorgRinger\News\Domain\Model\News {


/**   
* imageGalleryDownload
*
* @var bool
*/
protected $imageGalleryDownload = false;


/**
 * Returns the imageGalleryDownload
 *
 * @return bool $imageGalleryDownload
 */
public function getImageGalleryDownload()
{
    return $this->imageGalleryDownload;
}

/**
 * Sets the imageGalleryDownload
 *
 * @param bool $imageGalleryDownload
 * @return void
 */
public function setImageGalleryDownload($imageGalleryDownload)
{
    $this->imageGalleryDownload = $imageGalleryDownload;
}


/**
 * Returns the boolean state of imageGalleryDownload
 *
 * @return bool
 */
public function isImageGalleryDownload()
{
    return $this->imageGalleryDownload;
}

}

А на моем ТСА:

'image_gallery_download' => [
      'exclude' => false,
      'l10n_mode' => 'prefixLangTitle',
      'label' => 'Disable Image-Download function',
      'config' => [
          'type' => 'check',
          'items' => [
              '1' => [
                  '0' => 'Disabled'
              ]
            ],
          'default' => 0,
        ],
  ],

1 Ответ

0 голосов
/ 21 ноября 2019

Пожалуйста, смотрите мою жидкость ниже:

<f:section name="imageGallery">
    <div class="newsSiteHeader">
        <f:cObject typoscriptObjectPath="lib.imageGallery" />
    </div>
    <div class="news-img-gallery imageGallery" data-allowdownload="{f:if(condition: '{imageGalleryDownload} > 0', then: '0', else: '1')}">
            <div class="row">
        <f:for each="{media}" as="mediaElement" iteration="iteration">
                <div class="col-4 col-md-3 col-lg-4 pt-0 pr-2 pb-3 pl-2">
                    <div class="mediaelement mediaelement-image">
                                <f:if condition="{settings.detail.media.image.lightbox.enabled}">
                                    <f:then>
                                        <a href="{f:uri.image(image:mediaElement, width:'{settings.detail.media.image.lightbox.width}', height:'{settings.detail.media.image.lightbox.height}')}" title="{mediaElement.title}" class="{settings.detail.media.image.lightbox.class}" rel="{settings.detail.media.image.lightbox.rel}">
                                            <f:media file="{mediaElement}" title="{mediaElement.title}" alt="{mediaElement.alternative}" width="115c" height="115c" additionalAttributes="{data-originalfile: '{mediaElement.originalResource.originalFile.publicUrl}', data-figcaption: '{mediaElement.description}'}" />
                                        </a>
                                    </f:then>
                                    <f:else>
                                        <f:media file="{mediaElement}" title="{mediaElement.title}" width="115c" height="115c" alt="{mediaElement.alternative}" width="115c" height="115c"/>
                                    </f:else>
                                </f:if>
                    </div>
                    <f:if condition="{mediaElement.description}">
                        <p class="news-img-caption">
                            {mediaElement.description}
                        </p>
                    </f:if>
                </div>
        </f:for>
    </div>
    </div>
</f:section>
...