Giter Site home page Giter Site logo

Comments (15)

elliotcondon avatar elliotcondon commented on July 24, 2024 4

Hi guys,

Just an update on this issue. I've gone ahead and changed the class name from 'acf_field_date_time_picker' to 'acf_field_date_and_time_picker'.
This should completely avoid the collision and fix the issue.

I've also checked for other date time field types and this change shouldn't conflict with others.

@soderlind - it would still be great if you could add in a conditional check around your field type.
Check out another date time picker class here for an example: https://wordpress.org/plugins/acf-date-time-picker/.
This would allow me to change the class name back in the future (say in 6 months) when there is little chance of the conflict occurring.

Thanks again for your help notifying me of the issue. Hope everything else runs super smoothly from here on out.

Thanks
E

from acf-field-date-time-picker.

elliotcondon avatar elliotcondon commented on July 24, 2024 3

Hi @garrett-eclipse

Thanks for the reply. Yes, I've added in compatibility with unix timestamp values.
The date, datetime and time pickers will now be able to load and format previous values as expected.

Please re-download the plugin to make sure you have the latest code.
I'll reply back soon with a new documentation link on how to redownload the ACF PRO plugin

from acf-field-date-time-picker.

danielsteginga avatar danielsteginga commented on July 24, 2024 2

ACF Pro added a Date Time field, which uses the same name: https://www.advancedcustomfields.com/resources/date-time-picker/
I think that could be (part of) the problem

from acf-field-date-time-picker.

danielsteginga avatar danielsteginga commented on July 24, 2024

Hi,

I have the same problem on multiple websites right now. Also after updating ACF Pro.

from acf-field-date-time-picker.

ozziexsh avatar ozziexsh commented on July 24, 2024

+1, brought a few of our sites down.

Ours says line 405 though, which happens to be just the closing brace of the class. However the new acf_field_date_time_picker(); is next a few lines down.

Perhaps the file is being included more than once somewhere?

from acf-field-date-time-picker.

DTChristie avatar DTChristie commented on July 24, 2024

I have the same problem with ACF 5.3.9. It would be good to know how compatible the ACF version and the Soderlind version are, particularly concerning date/time conversions! Unfortunately there doesn't seem to be anything noted on the ACF website, even about the name clash!

from acf-field-date-time-picker.

garretthyder avatar garretthyder commented on July 24, 2024

Hey Guys,

So far so good on disabling the plugin before update, seems the field types are all mapped identically in the ACF update so the plugin isn't needed any longer. Done on two sites now without issues.

Steps;

  1. Deactivate Date Time Add-on plugin
  2. Update ACF
  3. Delete Date Time Add-on plugin
  4. Check field groups and front end for issues.

Hope that allays any fears with dropping it. Appears the data is stored in the same format so nothing gets lost on transition.

Cheers

from acf-field-date-time-picker.

DTChristie avatar DTChristie commented on July 24, 2024

HIya

I got the following response from Elliott (ACF):

Hi David

Thanks for the email.

I've just installed this 3rd party plugin and can see this error when active:

Fatal error: Cannot redeclare class acf_field_date_time_picker in /Users/elliotcondon/Dropbox/Work/Sites/acf5/wp-content/plugins/acf-field-date-time-picker/date_time_picker-v5.php on line 405

The plugin author has not wrapped his class definition within an if statement, and has used a class name exactly like ACF would. This is why we have ended up using the same name and the error occurs.

In theory you should be able to deactivate the 3rd party field type plugin, edit your field groups and change the existing field types to the new ACF date_time or time picker fields.

ACF saves the values to the DB in the most standardized format:
YYYY-MM-DD hh:ii:ss

If the existing plugin saved in a similar format, the 2 should be completely compatible and no change will occur to your website.

Thanks,
Elliot | Influx http://influx.com/?utm_source=customer&utm_medium=email&utm_campaign=acf
[email protected] mailto:[email protected]

It’s a little bit naughty to complain that the Third Party plugin, which has filled this gap well for quite some time and was even advertised in the past by ACF, clashes with the new field type that ACF has only just added! Anyhow, it seems that the built-in field type should (more or less) work compatibly as mentioned by Garrett.

Cheers, David

From: Garrett Hyder [mailto:[email protected]]
Sent: Mittwoch, 15. Juni 2016 18:24
To: soderlind/acf-field-date-time-picker [email protected]
Cc: DTChristie [email protected]; Comment [email protected]
Subject: Re: [soderlind/acf-field-date-time-picker] After acf Update class acf_field_date_time_picker is declared more than once (#103)

Hey Guys,

So far so good on disabling the plugin before update, seems the field types are all mapped identically in the ACF update so the plugin isn't needed any longer. Done on two sites now without issues.

Steps;

  1. Deactivate Date Time Add-on plugin
  2. Update ACF
  3. Delete Date Time Add-on plugin
  4. Check field groups and front end for issues.

Hope that allays any fears with dropping it. Appears the data is stored in the same format so nothing gets lost on transition.

Cheers


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #103 (comment) , or mute the thread https://github.com/notifications/unsubscribe/AGbxbFRFAmTjyCwd-Pr8etUfqp-zjrzzks5qMCcVgaJpZM4I1Esi . https://github.com/notifications/beacon/AGbxbK7GH6v9ZEUQyiwq8cYVgkmeM0tlks5qMCcVgaJpZM4I1Esi.gif

from acf-field-date-time-picker.

petertwise avatar petertwise commented on July 24, 2024

It’s a little bit naughty to complain that the Third Party plugin, which has filled this gap well for quite some time and was even advertised in the past by ACF, clashes with the new field type that ACF has only just added!

Totally agree. There's only a handful of great 3rd party plugins that are popular and really filling gaps in ACFs existing functionality. The ACF team should be aware of them and plan for compatibility when they release similar functionality.

from acf-field-date-time-picker.

petertwise avatar petertwise commented on July 24, 2024

ACF support forums just sent me this:

Hi @squarecandy

The ACF date time picker plugin is not supposed to be used with the newest version of ACF as it has the similar feature. It’s the same as the premium add-ons that are not supposed to be used with the PRO version. So you should disable that add-on to get the date time picker field working correctly.

That being said, I guess the plugin author forgot to add a compatibility with the old add-on. Could you please open a new ticket so it can be passed directly to the plugin author? You can open it here: https://support.advancedcustomfields.com/new-ticket.

Thanks 🙂

Please open a ticket if you have a pro ACF account and ask them to add compatibility with https://wordpress.org/support/plugin/acf-field-date-time-picker and to consider compatibility with 3rd party plugins that fill current gaps in ACF when launching new features in the future.

from acf-field-date-time-picker.

elliotcondon avatar elliotcondon commented on July 24, 2024

HI guys

Elliot here - ACF dev.

Firstly, allow me to apologize for any downtime you have experienced due to this PHP error.
Please know it is never my intention to break any functionality or website.
My intention is the complete opposite, to help web developers make awesome websites easier.

The issue here is that both ACF PRO and acf-field-date-time-picker are using the same class name for the field type. This is just pure coincidence.

@soderlind - please consider wrapping your field class in an if statement to prevent such an issue. This will help prevent this issue occurring on future updates. For example:

if( ! class_exists('acf_field_date_time_picker') ) :
class acf_field_date_time_picker extends acf_field {

}
endif;

Please note that the field classes within ACF PRO are all wrapped in if statements.

I'll consider changing the field class name from my end to fix this issue temporarily, however, this may cause the same issue with another existing 3rd party field type (unlikely but possible).

Unfortunately, these kinds of errors will happen from time to time, and are not malicious, but just an accident between 2 individual codes.

Let me know if you have any feedback or ideas for a solution.

from acf-field-date-time-picker.

garretthyder avatar garretthyder commented on July 24, 2024

Note: To those who did update to the ACF version and dropped this plugin. Beware if you were using the Time Picker and storing in linux time format then you'll have to update all that information as the new Time Picker type added by ACF doesn't support that format. @elliotcondon Can ACF Time Picker be updated to pick up linux time so as to support this data?
Thanks

from acf-field-date-time-picker.

garretthyder avatar garretthyder commented on July 24, 2024

Thanks @elliotcondon that's awesome, seems we're in clear waters now so should be smooth sailing from here on. I appreciate the update. Enjoy your weekend.

from acf-field-date-time-picker.

ethanclevenger91 avatar ethanclevenger91 commented on July 24, 2024

Just a note, if you need to update existing database values to MySQL style datetime rather than have ACF save out the datetime in UNIX, the following query should get you started:

UPDATE wp_postmeta SET meta_value = FROM_UNIXTIME(meta_value) WHERE meta_key = "acf_field_slug"

Might also consider AND meta_value != '' if you had it set to optional. If you've already added new events that are in the correct format, use AND post_id < x to prevent it from touching those, as it'll fail trying to format them.

The above implied that you could have it save to the database in Unix, but I'm not finding that to be the case. It'll return unix, but still goes into the database as MySQL datetime. Correct me if I'm wrong.

from acf-field-date-time-picker.

soderlind avatar soderlind commented on July 24, 2024

The lastest release fixes the compatibility problems with ACF PRO, ie:

  • Removed support for ACF PRO due to conflicts
  • My plugin is now following WordPress Coding Standards and hence the classes are in CamelCase

from acf-field-date-time-picker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.