Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with md_newsfrontend? #1

Open
AureliusHogan opened this issue Apr 7, 2021 · 7 comments
Open

Incompatible with md_newsfrontend? #1

AureliusHogan opened this issue Apr 7, 2021 · 7 comments

Comments

@AureliusHogan
Copy link

Hi,
thanks for this extension, it's great and works fine with georgringer/news.

But when using georgringer/news v 8.4 and mediadreams/md_newsfrontend v 2.0 the records for the md_unreadnews are only created for news produced in BE with georgringer/news. Viewing your hook tells me, that this actually is not possible. (There are no settings in constants done for feGroup or categories).

Is this the correct behavior?
Could it be that the hook is not touched when md_newsfrontend is used to create news?
Do I have to rewrite the md_unreadnews hook to use it with the signal slots that md_newsfrontend offers?

Any idea about this?

@cdaecke
Copy link
Owner

cdaecke commented Apr 8, 2021

Yes, you are absolutely right. The unread info is only created, if the news is created in the TYPO3 backend.

I would also go for the signal slot createActionAfterPersist in ext:md_newsfrontend.

@maartenmandemaker
Copy link

We might need this as well. Perhaps we can sponsor (part of) this feature?

@cdaecke
Copy link
Owner

cdaecke commented Apr 13, 2021

At the moment I am very short on time, so I can't provide a solution quickly.

You are welcome to share your thoughts about the implementation or even create a pull request.

@AureliusHogan
Copy link
Author

So I was working on a solution for this problem. It depends on:

  • my local version of md_newsfrontend:
    which I had to adapt to our needs for several other things. But the only change that matters is a further signal slot for UpdateActionAfterPersists (I'm not sure if this is correct or I should rather use UpdateActionBeforeSave)
  • a patch of md_unreadnews/classes/Hoocks/TCEmainHook.php
    in main point I changed the private functions to protected functions and moved the code to remove unread info to a separate protected function
  • a class in my sitepackage:
    sitepackage\slot\unread.php which is connected to the signals of md_newsfrontend. This class extends \Mediadreams\MdUnreadnews\Hooks\TCEmainHook. And therefor makes it possible to reuse the code in there to create the records.

That works fine.

@cdaecke
Copy link
Owner

cdaecke commented Apr 26, 2021

@AureliusHogan Sounds nice!

The signal slots createActionAfterPersist, updateActionBeforeSave and deleteActionBeforeDelete should be right, if you want to change the unread info on update and delete as well.

I would be interested in the other changes, that you made to ext:md_newsfrontend. Is there something, which you would like to see incorporated in the extension?

Do you mind sharing your code for the slot for others?

@AureliusHogan
Copy link
Author

I'm thinking of moving the slot code to this extension. I'll create a pull and upload it as soon as I'm ready.

For md_newsfrontend I'm working on:

  • multiple media,
  • multiple related files
  • sending e-mails if new messages arrived,
  • ....

Lots of changes ... I hope soon.

@AureliusHogan
Copy link
Author

So I've moved my slot code to md_unreadnews in the fork I created. Please have a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants