Articles icon indicating copy to clipboard operation
Articles copied to clipboard

will there be a version for modx 3?

Open ssl1984 opened this issue 3 years ago • 38 comments

Feature request

Summary

Quick summary what's this feature request about.

Why is it needed?

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Suggested solution(s)

A clear and concise description of what you want to happen.

Related issue(s)/PR(s)

Let us know if this is related to any issue/pull request.

ssl1984 avatar May 03 '21 20:05 ssl1984

Support for 3.x is a work in progress. Any help is welcome, you can use the develop branch to help test and submit issues and/or PR's!

JoshuaLuckers avatar May 04 '21 09:05 JoshuaLuckers

This issue has been mentioned on MODX Community. There might be relevant details there:

https://community.modx.com/t/need-help-with-mystery-connector-500-error/4978/6

rthrash avatar Feb 15 '22 16:02 rthrash

The error Ryan is talking about caused a completely empty resource tree. Commenting out the three "require_once" lines in the ArticlesContainer class fixed that (though Articles itself still doesn't work).

BobRay avatar Feb 15 '22 18:02 BobRay

That's probably been fixed with https://github.com/modxcms/Articles/commit/aaba11345c4cfda76f0a5872f5eb439878584c5d but there hasn't been a release yet I think.

Mark-H avatar Feb 15 '22 18:02 Mark-H

Any help with testing the things that are already done in the develop branch that would be great! Especially for those upgrading from an existing installation with Articles. But always make a backup!

JoshuaLuckers avatar Feb 15 '22 18:02 JoshuaLuckers

I had some time today to look into 3.x compatibility. I pushed some changes to the develop branch, installing it in 3.x still gives some errors. Most likely related to the validators in _build/resolvers/validators:

Could not get table class for class: modTransportPackage

Could not get table name for class: modTransportPackage

If someone knows a fix for this, please feel free to submit a PR. Otherwise I'll look into it myself sometime in the upcoming week.

JoshuaLuckers avatar Feb 16 '22 19:02 JoshuaLuckers

Thanks to @Mark-H I've solved the issue with the resolvers and validators.

There is still some work to do:

  • Quip isn't ready for 3.x yet and therefore can't be installed.
  • Load the Articles service using bootstrap.php since extension_packages is no longer being used in 3.x

JoshuaLuckers avatar Feb 20 '22 08:02 JoshuaLuckers

The ArticlesContainer isn't recognized as Document Type yet. So I have to fix that as well.

Probably because the schema is still for 2.x, but I want to maintain backwards compatibility with 2.x without releasing a separate version for 3.x. Any suggestions are welcome!

JoshuaLuckers avatar Feb 20 '22 09:02 JoshuaLuckers

Hey @JoshuaLuckers 👋🏻 I was playing around trying to get the Articles derivative modResource classes to be loaded in both 2.x and 3.x but haven't had much luck. 😅

It could be that having a separate version for 3.x is the easier (possible) path... if you're open to it? The main consideration I think would be to make sure the current version doesn't cause any errors during an upgrade from MODX 2.x -> 3.x, and then the user would upgrade to the 3.x version via the package manager after the MODX upgrade is complete.

What do you reckon?

muzzwood avatar Feb 23 '22 01:02 muzzwood

@muzzwood Thanks a lot for taking time to help out!

It could be that having a separate version for 3.x is the easier (possible) path... if you're open to it? The main consideration I think would be to make sure the current version doesn't cause any errors during an upgrade from MODX 2.x -> 3.x, and then the user would upgrade to the 3.x version via the package manager after the MODX upgrade is complete.

That seems like a good enough solution for me!

JoshuaLuckers avatar Feb 23 '22 07:02 JoshuaLuckers

Awesome! I'll get a PR together for you ;)

muzzwood avatar Feb 23 '22 11:02 muzzwood

WIP draft is here https://github.com/modxcms/Articles/pull/156 Can't be packaged yet but I hope to get that done later today.

muzzwood avatar Feb 25 '22 04:02 muzzwood

@muzzwood I've merged your PR. I'll try to update the changelog tomorrow and submit an alpha release of it.

JoshuaLuckers avatar Mar 28 '22 07:03 JoshuaLuckers

Great work guys!

BobRay avatar Mar 28 '22 14:03 BobRay

Sorry guys I didn't manage to put out a new release. I hope to do it soon. @muzzwood but feel free to put out a new release if you have more time for it.

JoshuaLuckers avatar Mar 30 '22 06:03 JoshuaLuckers

Hey @JoshuaLuckers, sorry for not replying sooner, it's been a crazy week. I could do a build/changelog and put through a PR for it but I'd need access for any more than that. ;)

Now that I think of it, we probably need to do the two releases (MODX 2.x and 3.x).

muzzwood avatar Mar 31 '22 03:03 muzzwood

@muzzwood if you have time to do that, that would be awesome and greatly appreciated. The little one is sick so my time is really limited but I can create a new release if you would be able to prepare it <3

JoshuaLuckers avatar Mar 31 '22 12:03 JoshuaLuckers

I've had good luck converting my extras to run in both MODX 2 and MODX3. Is there something unusual about Articles that makes that difficult? A single version would be a lot easier to maintain.

BobRay avatar Mar 31 '22 14:03 BobRay

Custom resource types are tough to get cross compatible due to some minor signature changes on the resource, and needing to extend either modResource or \MODX\Revolution\modResource - can't extend both at the same time in a single class.

Mark-H avatar Mar 31 '22 14:03 Mark-H

I'm working on a blog post about this, but here's the short version:

You can create a dynamic parent class that extends modResource in MODX 2 and \MODX\Revolution\modResource in MODX 3. Then the Articles class can extend the dynamic parent. I've had to do this with a couple of extras.

Here's an example of the Processor code from Notify:

if (class_exists('MODX\Revolution\Processors\Processor')) {
    abstract class DynamicProcessorParent extends MODX\Revolution\Processors\Processor {
    }
} else {
    abstract class DynamicProcessorParent extends modProcessor {
    }
}
class NfSendEmailProcessor extends DynamicProcessorParent { 
   /* Class code */
}

BobRay avatar Mar 31 '22 14:03 BobRay

There where also some issues with the model, schema en meta files that caused some issues with that approach. It's an approach we tried first.

JoshuaLuckers avatar Mar 31 '22 17:03 JoshuaLuckers

@muzzwood if you have time to do that, that would be awesome and greatly appreciated. The little one is sick so my time is really limited but I can create a new release if you would be able to prepare it <3

Aiming to get that sorted tomorrow morning 👍🏻

muzzwood avatar Apr 01 '22 10:04 muzzwood

This issue has been mentioned on MODX Community. There might be relevant details there:

https://community.modx.com/t/modx3-after-update-all-resources-in-web-vanished-suspected-issues-with-articles/5141/2

rthrash avatar Apr 01 '22 13:04 rthrash

2.x package: https://github.com/modxcms/Articles/pull/158 3.x package: https://github.com/modxcms/Articles/pull/157

muzzwood avatar Apr 02 '22 05:04 muzzwood

Thanks to the amazing work of @muzzwood and sponsorship of modmore, I released an alpha release for Articles 2.0 with support for MODX 3.

JoshuaLuckers avatar Apr 05 '22 19:04 JoshuaLuckers

I upgraded article to 1.8.0. then upgraded site to 3.0. Isee the 2.0 alpha package but cannot install it. Getting error Could not download and create transport package with signature: articles-2.0.0-alpha1

HarveyEV avatar Apr 06 '22 15:04 HarveyEV

I upgraded article to 1.8.0. then upgraded site to 3.0. Isee the 2.0 alpha package but cannot install it. Getting error Could not download and create transport package with signature: articles-2.0.0-alpha1

That's odd, I'll investigate it.

You can try to download the package and install it manually: https://github.com/modxcms/Articles/blob/develop-3x/_packages/articles-2.0.0-alpha1.transport.zip

JoshuaLuckers avatar Apr 06 '22 16:04 JoshuaLuckers

I updated to 1.8.0 without issues. Thanks for good work.

Quip is quite often used with Articles. That prevents from upgrading to MODX3. Will Quip be made MODX3 compatible? Migrating to another commenting system is an option too but continueing to use use Quip would be the easiest solution.

nsuomine avatar Apr 07 '22 19:04 nsuomine

Quip still needs some tweaks to work fully (it gives errors in the log about modAction when running on MODX3). @nsuomine if you're able to try upgrading a clone of your site to 3.0, and report any issues you face with Quip, I'd be happy to try solving them.

muzzwood avatar Apr 08 '22 03:04 muzzwood

@muzzwood Thanks for offering help.

Yes, Quip gives many warnings on 2.8.3 too but it still works. I understood that there is no more support for modAction in 3.0 so Quip would get broken? Do you think it would still work with the same warnings in the log.

nsuomine avatar Apr 08 '22 06:04 nsuomine