-
Notifications
You must be signed in to change notification settings - Fork 59
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
Backward Compatibility Issue : shortcode_atts renamed to props. shortcode_atts function equivalent absent #37
Comments
My modules are still compatible with the shortcode_callback functions but I'm not extending original Divi modules. Maybe you can just check if this or that exists in the parent class and make a call depending on that. Or you check the Divi Builder version to make that decission. In this thread the following is suggested: https://stackoverflow.com/questions/3046654/checking-if-an-overridden-parent-method-exists-before-calling-it
Maybe that helps you. Another suggestion would be to create two modules. One which is compatible with the old 3.0.x and one which is compatible with the new 3.1. In each modules class file, first add a check for the builder version and return early before actually creating the instance of the class to register it. Keep in mind that 3.0.x won't get any more updates so you can keep your existing function and just don't add new stuff. If ppl want new stuff, they can update to 3.1 |
Thanks @xxtesaxx . Yes it could very likely be the extension of the existing divi modules and/or the use of properties/functions which has no backward compatibility. shortcode_callback function could be backward as I haven't dug very deep into their code.
I like the idea of doing checks this way. I'll have total control over my code. It would be great if elegant theme comes out with a detailed list of things which can cause breaking changes so that we can factor those in our code.
This will only cause confusion as 2 modules will show up in the module list. Will lead to abandonment. Currently I feel like a Regards, |
The default implementation or
Only if you extend the core module, there is already a render function overwritten and therefore your |
@xxtesaxx Thats correct. shortcode_callback does have backword compatibility So I'll take my words back on that particular one !!! I'll conditionally check on shortcode_atts propery and shortcode_atts function (in the before_render function) and refactor my code accordingly. Thanks for your quick replies. Much appreciated. Have a great weekend! |
I managed to solve the backward compatibility issue. Step 1: Identify if the code is before/after version 3.1I used the following function below to do the identification.
Step 2: Replace the $shortcode_atts variable.With the new version, property So I will simply replace the Step 3: If your code uses parent::shortcode_atts() function, use the following below.
|
You shouldn't have had to do anything special for backwards compatibility. All of the properties and methods that were renamed have backwards compatibility code in-place. Could you provide us with a copy of one of the modules that appears to be broken due to renamed methods and/or fields? Thanks. |
Thanks @lots0logs I've sent you an email with the copy of broken and fixed plugin along with a brief description via email found on your github profile |
Thanks |
No, I'm afraid I haven't had a chance to look at it yet. I'm bogged down with GDPR stuff right now. As soon as that's done I'll be able to come back to this. Thanks for your patience. |
Hi @lots0logs, Any updates on this one? Thanks |
Unfortunately no, but the good news is that we've set aside time to address 3rd-party api bugs for the new backend builder release (which is in like ~3 weeks). This one is near the top of the list. |
Greetings @lots0logs . Any updates on this one? thanks |
Greetings @lots0logs . Hope you are doing well. Any update on this one? thanks |
Hi @ketanshah79, we're really sorry that it took us quite some time to address this. I'm Fikri from ET team; As @lots0logs mentioned at #37 (comment), we're currently addressing significant amout of issues for the upcoming release. Can you give me the access to your plugin? @lots0logs has forwarded the email you sent to him so i can take a look at the issue but once i tried to download the plugin i have no permission to do so. My email is my github username + @gmail.com. Thanks. |
thanks @fikrirasyid . I did receive an access request from you few days ago but rejected it :) I'll set up something by Monday. Thanks |
@ketanshah79 my pleasure. Yeah, sorry i was requesting it but forgot to follow it up here. There were couple of things happening 🤦♂️ Thanks, just let me know 👍 |
Hi @ketanshah79, is there any update regarding the access request? Thanks |
Apologies Fikri :)
Will send you an email tomorrow.
Regards
…On Tue, Nov 6, 2018 at 6:47 AM Fikri Rasyid ***@***.***> wrote:
Hi @ketanshah79 <https://github.com/ketanshah79>, any update?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHRkk8WwoH9OxNd3SgmkhFCd2YhfxpBks5usOMggaJpZM4Tp3nk>
.
--
"If you don't risk anything in life, you are risking even more"
|
@fikrirasyid sent :) |
Any updates on this one? Thanks |
Public property $shortcode_atts renamed to $props
ET_Builder_Element
class has renamedshortcode_atts
public property toprops
.This is a breaking change. It broke one of my modules which extends Divi's Image module. Another module which extends Divi's Button module is broken too.
Ideally, the module should have supported shortcode_atts and should have been phased out in a timeframe.
Assuming I fix this and release this, how am I am supposed to maintain backward compatibility with users who are using divi versions lessor than 3.1.
There are quite a few third party divi modules. I am surprised how little thought has gone into this. This is a very high-handed approach. There is no mention of this in the changelog too?
Below is a screenshot or the same.
Please bring back the deprecating code. Its hurting my business!
Regards
Ketan
The text was updated successfully, but these errors were encountered: