magento-2-blog icon indicating copy to clipboard operation
magento-2-blog copied to clipboard

class Post does not implement PostInterface

Open simonrl opened this issue 4 years ago • 4 comments

Summary (*)

Class Mageplaza\Blog\Model\Post is the preference for Mageplaza\Blog\Api\Data\PostInterface, but doesn't implement it. It's best practise in Magento to use interfaces in constructors etc. That does not work with this module.

Examples (*)

Use Mageplaza\Blog\Api\Data\PostInterface in a constructor; this will lead to this error:

Type Error occurred when creating object: Vendor\Module\Model\Export\Blog\Post, Argument 1 passed to Vendor\Module\Model\Export\Blog\Post::__construct() must implement interface Mageplaza\Blog\Api\Data\PostInterface, instance of Mageplaza\Blog\Model\Post given

Proposed solution

Make the class implement the interface and add the missing methods.

simonrl avatar Feb 11 '21 22:02 simonrl

Hi @simonrl ,

I'm Onesh from Mageplaza Support Team. Thank you for taking the time here to talk about the Blog module. I will surely note your precious feedback. Support from amazing customers like you helps our business grow and evolve thanks to your helpful feedback. We also enjoy working with you and hope to have many opportunities to do business with you for many years to come.

Looking forward to sharing your success.

phutx avatar Mar 24 '21 07:03 phutx

Hi Onesh,

thanks for your reply. Will this issue be fixed in a future version?

Thanks Simon

simonrl avatar Mar 24 '21 08:03 simonrl

Hi @simonrl ,

We will make our utmost effort to update it as soon as possible.

Thanks very much!

phutx avatar Apr 14 '21 04:04 phutx

Any plans on implementing this? I would submit a PR, but it seems like PRs that do not originate from MagePlaza are ignored.

lfolco avatar May 27 '22 21:05 lfolco