quickapps / cms

Modular CMS powered by CakePHP
GNU General Public License v3.0
164 stars 69 forks source link

Timepicker not showing on Date fields #173

Closed paulrwest closed 7 years ago

paulrwest commented 7 years ago

Timepicker is not showing in popup box when clicking on Date Field "Add a Time picker" is configured to be on. I have deleted the field and added a new Date field to double check.

From debugging I can see all the settings are correct and getting passed to JS so I think the issue could be in the timepicker plugin.

botchris commented 7 years ago

I'll take a look ;)

quickapps commented 7 years ago

I was completely unable to reproduce this issue 😩 , I've tried different configurations and seems to work just fine.

Could you provide information about how your date field is configured? Can be this related to the browser you are using?

This Date Field was refactored time ago in order to add new features, could this be related to?

Here are the settings I'm using when trying to reproduce the issue (all this using a new fresh installation):

screen shot 2017-01-12 at 21 22 41 screen shot 2017-01-12 at 21 23 03
paulrwest commented 7 years ago

So I have deleted everything in vendor and done a composer update to make sure I'm running latest.

I have copied your settings and still no time, not sure what could be causing it debug shows no errors

image

image

The JS built for the input:

$(document).ready(function() {
        $('#dp-container-event-start-date .picker').datetimepicker({
            showAnim: 'drop',
timeOnlyTitle: 'Choose Time',
timeText: 'Time',
hourText: 'Hour',
minuteText: 'Minute',
secondText: 'Second',
millisecText: 'Milliseconds',
showSecond: true,
ampm: true,
dateFormat: "yy-mm-dd",
timeFormat: 'H:mm:ss',
showButtonPanel: true,
changeMonth: true,
changeYear: true,
showWeek: true,
firstDay: 1,
numberOfMonths: 3        });

        var dateFormat = $('#dp-container-event-start-date .picker').datetimepicker('option', 'dateFormat');
        $('#dp-container-event-start-date .format').val(dateFormat);

                    var timeFormat = $('#dp-container-event-start-date .picker').datetimepicker('option', 'timeFormat');
            var currentVal = $('#dp-container-event-start-date .format').val();
            $('#dp-container-event-start-date .format').val(currentVal + ' ' + timeFormat);
            });
paulrwest commented 7 years ago

Ok after some debugging and testing it is adding an attachment field that breaks the timepicker section of the Date field there are no errors I will try and work out whats blocking what

botchris commented 7 years ago

So using both Attachment Field & Date Field at the same time causes the problem?

paulrwest commented 7 years ago

Yes, I had a quick look at why but couldn't see the exact reason, the HTML/JavaScript built for the date field is identical, the order the fields are in seem to have no effect. from a quick step debug it looks as though the timepicker skips the building process.

botchris commented 7 years ago

I was totally unable to reproduce the issue; I've tried adding both Date and Attachment fields to my "Article" content type and everything seems to works just fine, I was able to upload a file as attachment and select a date and time from the picker.

screen shot 2017-02-15 at 21 57 00
paulrwest commented 7 years ago

Hi Chris,

I'm not sure whats causing it but it's not a quickapps issue so feel free to close and sorry for wasting your time.

I have it working on the test server (running in a Docker container) but still not working locally (Also running in Docker but which is really odd so I think its a system config issue or a windows/linux issue.

Paul

botchris commented 7 years ago

Dont worry 😄

Can it be related to JS script files not being properly loaded by the browser? I've seen similar issues when running virtual machines caused by some kind of dark magic coming from Apache. Check apache's mod_gzip, mod_rewrite, etc. and make sure resources are being properly loaded by the browser.

Closing this ticket, but feel free to comment whenever you want.

Regards!