WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

You are not logged in.

#1 16.04.2019 22:37:14

losttrip
Member

OFA OneForAll Timing Enable Disable not functioning

WB 1.3.3
OFA 1.0.9
PHP 7.2

I have installed a custom OneForAll module on a site.  I've used custom OneForAll modules on a lot of site.  But I guess I have never tested the Timing (start end time) function.

Everything else is working, but I can not get the timing (Enable and Disable date/time) to work.

For instance, I would like to have a post delay appearing until a later date, so I set the Enable to a future date.  But the item still shows Active (green light) in the backend, and is visible on the frontend.

The same happens if I just set an end date/time.  I get a success message on save, but once that date/time passes, the item shows red light for Active, but it is still visible in the frontend.

I can't figure out what is happening.

And if I try to set a start and end time, I get a red warning, for example:

The scheduled start time "04/17/2019 at 04:00" must be before the end time "06/14/2019 at 05:33".

even though the start date and time IS before the end time.
I have experience with the timing in the News module, and this does not seem to be working in the OFA.

The only way I can get the Active red light to show in the backend, is through a series of events.

  1. set the start date/time

  2. click Save - I get a Success message

  3. set an end time, Save, I get the warning

  4. when I click Back, the Active light is gone (not green or red) and the end time is changed to the same as the start.

  5. click save again

  6. leave the ofa backend page

  7. return to the backend page and the active light is red, click save

  8. ...and SOMETIMES this seems to work... but the more I test the more confused I get.

Offline

#2 16.04.2019 23:00:41

losttrip
Member

Re: OFA OneForAll Timing Enable Disable not functioning

I know that is a confusing mess.  I should have just said, can someone test to see if their OFA install Timing start end date functionality works... because mine doesn't seem to on any of my installs.

Thank you.

Offline

#3 17.04.2019 00:36:09

bernd
Developer

Re: OFA OneForAll Timing Enable Disable not functioning

I would suspect that there is a problem/bug with the date-format that didn't consider the date format from the settings.

The scheduled start time "04/17/2019 at 04:00" must be before the end time "06/14/2019 at 05:33".

It seems like the dates are interpretet in a "German" notation, what would read in your example as:
FROM 4. day of the 17. month TO 6. day of the 14. month
which is obviously total nonsense - but the resulting error-message is correct, because the start month is higher then the end month.

Could you please crosscheck this, while setting the dateformat to "D.M.Y" in settings -> default settings.
(Not quite sure: it maybe you have to change the format in "preferences" also and/or have to logout and login again)
You must than set new dates in your OfA for the change come into effect.

Just had a look in the source-code. It looks like the script "guesses" a wrong date-time format and/or language settings.
For example if your language setting is DE (where the date setting is d.m.Y) but you have (forwhatever reason) set the dateformat to EN-style (m/d/Y) the script gets confused because it first read the language settings and works with this.

You can overwrite this behavior in the config.php in the modules folder. Look for the line

$scheduling_format = '';

Set there a format-string correspondending to your date/time settings in the backend. See also the example in the config.php some line above this entry.
You can also set temporarily some lines above the

$scheduling_debug = true;

that will give you some text-output in the OfA which will (hopefully) make some things more obvious.

Last edited by bernd (17.04.2019 01:10:18)


... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...

Online

#4 17.04.2019 00:58:17

losttrip
Member

Re: OFA OneForAll Timing Enable Disable not functioning

I'm happy to try anything!

I changed my Settings Date Format from "Apr 16 2019" to "16/04/2019 (D/M/Y)" and clicked save.
My Preferences Date Format is set to "16/04/2019 (System Default)".
I logged out.  Cleared cache and cookies, and shut down browser.

When I log back in, the calendar Dialogue in OFA still selects in M/D/Y format " 04/16/2019 at 18:55"
And the same issues occur.
Even if I manually enter the date in D/M/Y format "16/04/2019 18:55" the same issues occur.

Does the timing work in your installation?

Edit: I just re-read your post.  I tied you suggestion of date format "D.M.Y (16.04.2019)".  Same results.

Last edited by losttrip (17.04.2019 01:09:21)

Offline

#5 17.04.2019 01:11:53

bernd
Developer

Re: OFA OneForAll Timing Enable Disable not functioning

I added some lines to my previous post, please re-read ist again.


... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...

Online

#6 17.04.2019 01:13:28

losttrip
Member

Re: OFA OneForAll Timing Enable Disable not functioning

Don't know if this will be of any help, but I just entered a start and end date, and got this message:

The scheduled start time "04/16/2019 at 19:11" must be before the end time "04/17/2019 at 00:00".

I looked in the database, and the "scheduling" field shows:

a:4:{s:5:"start";s:19:"04/16/2019 at 19:11";s:3:"end";s:19:"04/16/2019 at 19:11";s:8:"ts_start";i:943920000;s:6:"ts_end";i:943920000;}

Offline

#7 17.04.2019 01:15:02

bernd
Developer

Re: OFA OneForAll Timing Enable Disable not functioning

Just to get a better picture of all of this:
- whats your normal (every day used) language setting?
- whats your normal (every day used) date-format setting?


... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...

Online

#8 17.04.2019 01:15:56

losttrip
Member

Re: OFA OneForAll Timing Enable Disable not functioning

I will re-read your initial post and test.  Will be in a little while.
The reason I am using English date format, is because the site is in English (as am I).

Offline

#9 17.04.2019 01:34:05

bernd
Developer

Re: OFA OneForAll Timing Enable Disable not functioning

o.k. I poked around a little bit more in the fog ;-)

The main reason that it not works is a missing language-file for the datepicker!
Two possibilities to fix this:
1.) setting a date format in the config.php as described above - this will overwrite the lookup for the datepickers language file
2.) in the folder /include/jquery/i18n/ just copy the file jquery.ui.datepicker-en-GB.js to jquery.ui.datepicker-en.js and all will be fine


... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...

Online

#10 17.04.2019 03:06:15

losttrip
Member

Re: OFA OneForAll Timing Enable Disable not functioning

bernd wrote:

Just to get a better picture of all of this:
- whats your normal (every day used) language setting?
- whats your normal (every day used) date-format setting?

Canada
English
Apr 16, 2019 - Month Day Year

Offline

#11 17.04.2019 03:10:23

losttrip
Member

Re: OFA OneForAll Timing Enable Disable not functioning

bernd wrote:

o.k. I poked around a little bit more in the fog ;-)

The main reason that it not works is a missing language-file for the datepicker!
Two possibilities to fix this:
1.) setting a date format in the config.php as described above - this will overwrite the lookup for the datepickers language file
2.) in the folder /include/jquery/i18n/ just copy the file jquery.ui.datepicker-en-GB.js to jquery.ui.datepicker-en.js and all will be fine

Thank you so much for your time.  I think I will go with option 2, but I will look into the other option as well, especially the debug.

Offline

#12 17.04.2019 03:36:06

bernd
Developer

Re: OFA OneForAll Timing Enable Disable not functioning

You're welcome.

Just an additional note:
in the en related datepicker languages files the dateFormat is (the hell knows why?!?) defined as

dateFormat: 'dd/mm/yy'

you can easily change this to

dateFormat: 'mm/dd/yy'

... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...

Online

#13 17.04.2019 04:02:01

losttrip
Member

Re: OFA OneForAll Timing Enable Disable not functioning

Not sure if you're being sarcastic when you say "the hell knows why?"
UK English uses dd/mm/yy I believe, and the US is more mm/dd/yy
It's not set in stone in Canada, we use both... and then some more.

As far as numbered dates, I really don't have a preference, but written dates, I use April 16, 2019, and never 16 April 2019, or 2019, 16 April (which are both also used here)

But the important news is that you found this missing file, so it can be added for the next WBCE version, I hope.

Thanks again!

Last edited by losttrip (17.04.2019 04:02:56)

Offline

#14 17.04.2019 06:54:36

florian
Administrator

Re: OFA OneForAll Timing Enable Disable not functioning

@bernd Thanks for your time and effort digging into it. I probably would never have found the solution to this.
@losttrip: Does it work now?

I think the issue should be fixed in the module itself, not in the core (as I wrote also as an answer to the Github Issue).  Nevertheless the solution of copying the "wrong named" language file can be applied as a quick fix of course.
Since the module is orphaned, we could fix it corresponding to our needs for future uses.

Last edited by florian (17.04.2019 06:56:52)

Offline

#15 17.04.2019 11:44:29

losttrip
Member

Re: OFA OneForAll Timing Enable Disable not functioning

Yes copying the file jquery.ui.datepicker-en-GB.js to jquery.ui.datepicker-en.js worked.
Why is this called a quick fix and not suggested?  Is there not supposed to be an English language file = jquery.ui.datepicker-en.js in the core?

Sadly, many of the modules I have found most useful and have built sites upon are now being called "orphaned" or "archived".

Offline

#16 17.04.2019 12:37:31

florian
Administrator

Re: OFA OneForAll Timing Enable Disable not functioning

The i18n package does only contain jquery.ui.datepicker-en-GB.js .
https://github.com/jquery/jquery-ui/tree/master/ui/i18n
Yes, you can apply it as a fix, but actually it's an issue of the module, not the core package or jquery UI.

About modules: You can continue using them, but there is no warranty that every question concerning them will be answered or issues can be fixed.

Offline

#17 17.04.2019 15:32:55

bernd
Developer

Re: OFA OneForAll Timing Enable Disable not functioning

@florian:
I understand your point of view.
This is a bug in the module, because there is no fallback for a missing  ui language-file.

But it is probably also a failure of the jquery-ui maintainer. For other languages with variants, there is always also a generic file (fr-CA - fr-CH - fr / it-CH - it / nl-BE - nl / ...) present.

@losttrip:
yes the "the hell knows why" was meant to express my surprise, because I mainly associate the format m/d/y with the english language and in all the english variants (-GB -AU -NZ) in this folder it is written as d/m/y

Last edited by bernd (17.04.2019 17:12:04)


... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...

Online

#18 17.04.2019 17:24:45

bernd
Developer

Re: OFA OneForAll Timing Enable Disable not functioning

Puuuh ... it's not as trivial as it looks at a first glance.
The datepicker himself has a fallback for missing language files with a hardcoded dateFormat mm/dd/yy which interferes with the languages settings (dd/mm/yy) used to build the format-string in the save.php
Looks like I have to dig a bit deeper in the module.


... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...

Online

#19 17.04.2019 22:22:39

losttrip
Member

Re: OFA OneForAll Timing Enable Disable not functioning

@florian - Obviously I don't comprehend the situation.  I was not suggesting there was an issue with the core, I misinterpreted bernd's solution as meaning there was a file missing.  My mistake.  About modules - I also was not complaining about the state of modules, or WBCE, I realize that volunteers will come and go, and it is not necessarily a reflection of the health of the project as a whole.  That's all I will say.

@bernd - are you saying that neither of your previously suggested solutions are reliable?

Offline

#20 17.04.2019 22:50:07

bernd
Developer

Re: OFA OneForAll Timing Enable Disable not functioning

Both solution are reliable.
1. changing the variable in the modules config.php is the intended way to force a specific date format
2. copying the "missing" datepickers language file is a quick -fix

Fixing this issue direct in the module is our way of choice

It took me some time to understand the underlaying mechanics and what exactly goes wrong to find a way to fix it - hopefully - as effective as possible.
The "missing" file is not realy missing because the datepicker-core defaults to "en" if no language file is found.
This works fine inside the edit-from, but will fail during saving the data 'cause in this file the datepicker is not needed and so it is not loaded so there is no fallback.

I think I will have a appropriate fix later this night (<== here in Germany).


... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...

Online

Liked by:

florian

#21 17.04.2019 22:55:51

losttrip
Member

Re: OFA OneForAll Timing Enable Disable not functioning

Okay, thanks again for your time.

In the meantime, I will remove the "quick-fix" and I will implement the other fix.

Offline

#22 18.04.2019 01:02:44

bernd
Developer

Re: OFA OneForAll Timing Enable Disable not functioning

So here is the fix for this odd behavior.

@losttrip:
if you want to test it:
- revert all the changes you probably made during our bug-hunting last nicht
- unzip the attached file
- replace the save_item.php in your modules folder(s) with this version

@florian:
should I build a new module package with this fix?


... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...

Online

Liked by:

florian

#23 18.04.2019 07:06:12

florian
Administrator

Re: OFA OneForAll Timing Enable Disable not functioning

should I build a new module package with this fix?

Already done. I've also updated the download in the AOR.

Offline

#24 19.04.2019 00:13:16

losttrip
Member

Re: OFA OneForAll Timing Enable Disable not functioning

@bernd - In my search to find a possible cause of the problem, I did a lot of code comparisons and I found that exact same change (without comments) was implemented in VERSION 1.0.3 (01/22/2017) of the "other" CMS version of OFA.  There are also a whole lot more changes/updates since then.  I originally assumed that WBCE version 1.09 was at the same development timeline as the "other" version was at 1.09.  Guess I should not assume.  This isn't a criticism, just a realization.

Thank you for following through on this issue.

Edit: Please ignore the strike-through text.  I must have been dreaming that I saw this code in the "other" CMS version, because I can now not find it.  Puzzling.

Last edited by losttrip (19.04.2019 12:50:58)

Offline

#25 19.04.2019 03:19:15

losttrip
Member

Re: OFA OneForAll Timing Enable Disable not functioning

I reverted all previous changes and tested the new file, and it seems to be functioning perfectly.

Cheers!

Offline

Board footer

Powered by FluxBB

up