fnagel / t3extblog

A record based blog extension for TYPO3 CMS. Easy to use and packed with features (incl. comments, subscriptions for comments and posts, Wordpress like subscription manager, reasonable email sending in FE and BE, GDPR ready, BE modules, Dashboard widgets, RSS, Sitemap, ...). Flexible and powerful!
http://typo3.org/extensions/repository/view/t3extblog
GNU General Public License v2.0
33 stars 19 forks source link

Error in listview after posting a new post #181

Closed eiszeit closed 6 years ago

eiszeit commented 6 years ago

I am using typo3 76.23 and t3extblog 2.2.2 in a multilanguage enviroemnt. Post will be unhidden automatically by using the date/time field. It seems that everytime a new post is made visible I get this error:

PHP Catchable Fatal Error: Argument 1 passed to TYPO3\T3extblog\Controller\PostController::categoryAction() must be an instance of TYPO3\T3extblog\Domain\Model\Category, null given in /html/typo3/typo3conf/ext/t3extblog/Classes/Controller/PostController.php line 64

Strangely I get this error for the second language only and in combination with realURL. If I view the page index.php?id=25&L=1 everything works fine with de/neuigkeiten/ it throws that error. After I clear the URL path data it works again until I post a new post.

I am using the blog in list view, single view and with categories. All other options are working fine except for the list view in combination with realURL.

eiszeit commented 6 years ago

at least an idea about the error code, please?

fnagel commented 6 years ago

It seems that everytime a new post is made visible I get this error:

When and where do you get this error?

Does it work when you just release a post (so without using the start / end date fields)?

Strangely I get this error for the second language only

Are the related categories translated?

I am using the blog in list view, single view and with categories. All other options are working fine except for the list view in combination with realURL.

So, the error happens only in the list view?

at least an idea about the error code, please?

Sounds like the category is not found. Maybe because it's not translated. Question is: the categoryAction is used for the filtered list view so this should only occur when clicking on a category link.

eiszeit commented 6 years ago
It seems that everytime a new post is made visible I get this error:

When and where do you get this error?

Right now I can´t reproduce it. The error turns up after I wait a while (hours).

Does it work when you just release a post (so without using the start / end date fields)?

Yes it does.

Strangely I get this error for the second language only

Are the related categories translated?

Yes they are. I am usind a categoy menu as well. However there are categoreis with the same name in german and english, e.g. sport, but realUrl chages one to sport-1, should be okay.

I am using the blog in list view, single view and with categories. All other options are working fine      except for the list view in combination with realURL.

So, the error happens only in the list view?

Yes and only one list view. I am using this plugin on the page home in list view (en/de), no problems here. And then I have a seperate page for more posts (en/de), this where I got the problem, but in german only.

at least an idea about the error code, please?

Sounds like the category is not found. Maybe because it's not translated. Question is: the categoryAction is used for the filtered list view so this should only occur when clicking on a category link.

I thought so too and found 2 posts without category. I assigned them a category but the error was still there. Clicking on categories at the posts and/or menu doesn´t produce this error. I also deactivated the german list view on the page where I got the problem, by default the english posts appear and I get the same error.

I think the problem started for me after patching version 2.2.1, I tried 2.2.2 and have now 3.0 installed, same error here. I am using 2 different system folders for the plugin, one with the english and one with the german posts. Maybe this could be the problem, I just assigned the default sytem folder in constants for english and german. Did that change in from versions 2.2.1 to 2.2.2?

fnagel commented 6 years ago

Right now I can´t reproduce it. The error turns up after I wait a while (hours).

I would really need a step by step guide how to reproduce the issue in order to help out here.

However there are categoreis with the same name in german and english, e.g. sport, but realUrl chages one to sport-1, should be okay.

That sounds like you are having general RealUrl issues. Having the same name in different languages should be no problem. How does the URLs look like?

I thought so too and found 2 posts without category. I assigned them a category but the error was still there. Clicking on categories at the posts and/or menu doesn´t produce this error.

That's sounds very strange as the action throws an error and the action is never called in another context. Sounds like an RealUrl issue (calling the wrong action).

I think the problem started for me after patching version 2.2.1, I tried 2.2.2 and have now 3.0 installed, same error here.

So version 2.2.0 works? Can you verify?

I am using 2 different system folders for the plugin, one with the english and one with the german posts.

That's not how you should do this in TYPO3. May work, but is untested.

Maybe this could be the problem, I just assigned the default sytem folder in constants for english and german. Did that change in from versions 2.2.1 to 2.2.2?

Not sure what you did here. Please post your config.

After all, this sounds more like a usage problem than an issue with this extension.

eiszeit commented 6 years ago

I can not verify version 2.2.0, version 2.2.2 is the earliest version available in the TER, therefore I can´t test other versions. The URLs are looking good, like: article/day/month/year/post. I installed this blog approx 1 year ago, it was not working with translated posts at that time, therefore I deceided to have 2 plugins one for each language with a sytem folder for each language. That was running fine for a year now.

I tried to edit the constants:

plugin.tx_t3extblog.persistence.storagePid = 26
[globalVar = GP:L = 1]
plugin.tx_t3extblog.persistence.storagePid = 42

[global]

it seems not to work, but I got the same error again.

I would like to get a step by step guide, but I don´t know how that error occurs.

fnagel commented 6 years ago

I need complete URLs not just pseudo ones.

Old versions are available vie GIT, even the t3x files. Please, be a little more proactive here.

I installed this blog approx 1 year ago, it was not working with translated posts at that time

Sure it did. Since version 1.2.0 (mid 2015).

I tried to edit the constants:

How does your records language config look like (all, default, specific language)? Anyway, that's not how TYPO3 localization should be used. Maybe this works but its untested and I not willing to debug this.

Why not using the default way?

eiszeit commented 6 years ago

This is the website I am having the issue with. http://www.gondwana-collection.com/ The plugin is used as a news plugin on the page home (with 2 posts) and on the page news. The problem appears on this page: https://www.gondwana-collection.com/de/neuigkeiten/ but not right now. I just rebuild this page new to test if the actual page is broken. I have developped this page in 2015, here ist the link to the test eviroment http://typo3.p375830.webspaceconfig.de/de/ it´s working fine there. The main difference between these 2 is the gondwana-collection website was patched and the error appeared at that time approx 14 days ago. The other page was not patched both are running on version 3.0 at the moment. Posts are in default language in a sepearte folder, when using the plugin I selected different folders for each language in "record storage page" option. As I pointed our earlier, it was not working for me when we started this project, but with different folders it was until 2 weeks ago. Sorry for being not proactive, I thought you could maybe point me in the right direction to sort this issue.

eiszeit commented 6 years ago

The error occurs when realURL creates this url:

speaking url: de/neuigkeiten/

original URL L=1&cHash=299de4fb343d8cfe30b62ce70f45d510&id=86&tx_t3extblog_blogsystem%5Baction%5D=category&tx_t3extblog_blogsystem%5Bcategory%5D=0

after that I get the error above.

Working URLs are:

de/neuigkeiten/ L=1&id=86 de/neuigkeiten/?no_cache=1 L=1&id=86&no_cache=1

as are created in the other languages.

All other original URLs are missing the category (maybe this helps) and are looking like this:

L=1&cHash=657affcca3b2edee73bacb149073e450&id=86&tx_t3extblog_blogsystem%5Baction%5D=show&tx_t3extblog_blogsystem%5Bday%5D=06&tx_t3extblog_blogsystem%5Bmonth%5D=11&tx_t3extblog_blogsystem%5Bpost%5D=230&tx_t3extblog_blogsystem%5Byear%5D=2015

fnagel commented 6 years ago

L=1&cHash=299de4fb343d8cfe30b62ce70f45d510&id=86&tx_t3extblog_blogsystem%5Baction%5D=category&tx_t3extblog_blogsystem%5Bcategory%5D=0

This seems odd. The list view should definitely not using the category action. No idea why it does that. Actually the URL to a page with a list view should just look like this: L=1&cHash=299de4fb343d8cfe30b62ce70f45d510&id=86 -- without any action. Like the URL example at the end of your comment.

What renders that wrong link?

Do you include all needed TS? Please show me your config.

eiszeit commented 6 years ago

I really don´t know what renders that wrong link, I think this is the key question here.

I am using realURL autoconf right now, was using my own file which was looking exactly as the auto one. I was using realURL 2.1.8 and tried to use 2.1.9 right now, no difference here.

I have included the default static template and additional realURL config as static template on page "home". constants: plugin.tx_t3extblog.persistence.storagePid = 26 plugin.tx_t3extblog.settings.blogsystem.pid = 86 plugin.tx_t3extblog.settings.subscriptionManager.pid = 86 plugin.tx_t3extblog.settings.blogsystem.posts.paginateitemsPerPage = 1 plugin.tx_t3extblog.settings.previewImage.width = 320 plugin.tx_t3extblog.settings.blogName = GC News plugin.tx_t3extblog.settings.emailFrom = plugin.tx_t3extblog.settings.emailTo =

all other setting in deafult mode, I have included the email address above, just removed it here

setup: plugin.tx_t3extblog.settings.blogsystem.posts.paginate.itemsPerPage = 2

and on page "news" setup: plugin.tx_t3extblog.settings.blogsystem.posts.paginate.itemsPerPage = 10 lib.tx_t3extblog.responsiveImage.params = class="img-responsive"

I have not changed these parameters when upgrading from 2.2.1 to 2.2.2 or 3.0

I also changed one line in /ext/t3extblog/Resources/Private/Templates/Post/list.html line 9 for t3extblog 2.2.1 from

to to link the headline to the page news in order the "single view" was displayed on the page news and not home. Worked in all versions.
eiszeit commented 6 years ago

it seems this link:

{category.name} creates the URL above. Found in t3extblog\Resources\Private\Partials\Post\Categories.html Any idea why this is called?
fnagel commented 6 years ago

Yes, that link action will render the link causing the error but I have no idea why its called at all.

Did you tried to clear real url cache? Perhaps it's something wrong. Try using textblog without all customization maybe another idea to track down where the error comes from.

eiszeit commented 6 years ago

I was able to find the problem but not what caused it. We have several news on that website, some of them with 2 or more categories. Normally a news looks like this: date, author - category1, category2. For some reason two of my news were a category missing; it looked like: date, author - , category2.

Although in the backend 2 categories were selected, just one was displayed in the frontend. If I deselected one and later selected a second one the error was gone.

I remember now we chose 2 system folders because we wanted to have categories in different languages as well and that option was not available when I installed this extension. Maybe that would be a nice feature for the future. Thank you for your help.

fnagel commented 6 years ago

Glad you were able to fix your problem!

Translated categories should be possible afaik if that is what you wanted to have when saying "we wanted to have categories in different languages".

Please feel free to open a FR ticket if you thing there is something missing!