lochmueller / calendarize

📆 Best TYPO3 Calendar ever 📆
http://typo3.org/extensions/repository/view/calendarize
75 stars 84 forks source link

TCEMAIN preview core functionality? #737

Open kanow opened 1 year ago

kanow commented 1 year ago

Is it possible to use an "View" button in backend to get a preview of the current event?

I tried to configure this TCEMAIN.preview stuff in page ts config. I use the following page ts:

TCEMAIN.preview {
  tx_calendarize_domain_model_event {
#    previewPageId = 123
    useDefaultLanguageRecord = 0
    fieldToParameterMap {
      uid = tx_calendarize_calendar[event]
    }
    additionalGetParameters {
      tx_calendarize_calendar.action = detail
      tx_calendarize_calendar.controller = Calendar
    }
  }
}

The button is generated but if I use the View Button a new page will be opened with an exception

(1/1) TypeError
Argument 1 passed to HDNET\Calendarize\Utility\EventUtility::getOriginalRecordByConfiguration() must be of the type array, null given, called in /app/web/typo3conf/ext/calendarize/Classes/Controller/CalendarController.php on line 102

any Idea?

lochmueller commented 1 year ago

Hey @kanow , do you use the EXT:calendarize event or a custom event type? Do you try to set also the "extensionConfiguration" argument to force rendering the right configuration: https://github.com/lochmueller/calendarize/blob/master/Classes/Controller/CalendarController.php#L91 Regards, Tim

kanow commented 1 year ago

Hey what a quick response :-)

I use the calendarize Event. And yes, with setting

additionalGetParameters {
      tx_calendarize_calendar.action = detail
      tx_calendarize_calendar.controller = Calendar
      tx_calendarize_calendar.extensionConfiguration = Event
    }

the View button works. But I thought that can be a preview for the record without saving? After clicking the View Button I choosed the followed option "View without changes" but then I have another error:

(1/1) TypeError
Argument 1 passed to HDNET\Calendarize\Domain\Repository\IndexRepository::findByEventTraversing() must implement interface TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface, null given, called in /app/web/typo3conf/ext/calendarize/Classes/Controller/CalendarController.php on line 103

If I choose "Save changes and view" the event is already visible in my list view on the website. That's not what I want. Or should I use another value for extensionConfiguration argument? Thanks for your help.

kanow commented 1 year ago

Mmmh.. I think it's not possible to use those preview feature for a preview and hidden in the current list view. Is just possible to go directly to the detail page for those entry. Issue can be closed if nobody has another idea.

In news there is an setting to allow preview of hidden records. That would help if there is such a setting in calendarize. Is there a setting for this in calendarize, maybe in pluginConfiguration?

lochmueller commented 1 year ago

No. There is no such settings currently (as far as I know :))

kanow commented 1 year ago

OK, thx.