Forum Replies Created

Viewing 15 replies - 31 through 45 (of 46 total)
  • Actually I was able to get it working on the latest version from github.

    Just drop the src folder and scss.inc.php into the plugin’s scssphp/ folder.
    Then edit ./scssphp/src/Compiler.php, line 188, change to:
    $this->formatter = new Nested();
    Am unsure why this error occurs, might be php version 7 causing it.

    And on ./class/class-wp-scss.php, insert new line before class def:

    use Leafo\ScssPhp\Compiler;
    
    class Wp_Scss {

    Runs great.

    agreed. will have to use another solution until then.

    https://github.com/leafo/scssphp/issues/146

    I tried to do it myself, but looks like code has changed, and this plugin would need altered. Can’t just swap the new code in.

    seriously. nothing?

    Thread Starter ensemblebd

    (@ensemblebd)

    Nevermind was able to figure out what went wrong. Apologies!

    This also occurs when a theme is running apply_filters(‘the_content’) on the output generated by this shortcode. Since the javascript is considered part of it, your theme can be injecting invalid <p> tags into the javascript body, causing the malfunction.

    I had to remove the filter from my theme in order to support this plugin. It would be better that I need not do that, but sacrificing good wordpress code for a good slider is an easy decision in my case.

    Honestly, I don’t see why the script can’t be added to the header. Yes it’s dynamically generated, but you can easily add custom javascript to the header in wordpress. Or at the least, keep the javascript for the shortcode (not the html), outside of THE_CONTENT. Just saying, that’s what I would do if I was maintaining this plugin.

    Thread Starter ensemblebd

    (@ensemblebd)

    That is very likely; as I can’t imagine I’d be the only one reporting the issue – if it were anything other than the environment that I have running.
    So there must be a conflict by some means, somewhere. Since it’s a production site I can’t run tests on it, but I’ll see about transferring it to a local install for testing, and see if I can locate which plugin or theme-code would produce such a situation.

    Also thank you for the support ??

    Thread Starter ensemblebd

    (@ensemblebd)

    Ok, this is not a plugin issue, but a wordpress issue. And is the way wordpress handles drafts.
    A draft converts the page from published, and results in a 404 because the word “draft” doesn’t mean to create a draft, but to literally remove the published page and begin drafting it.

    Has nothing to do with this plugin. Marking topic resolved.

    Thread Starter ensemblebd

    (@ensemblebd)

    looks like you need:

    require_once(ABSPATH . ‘wp-admin/includes/screen.php’);

    added to your source code, using an if function exists conditional

    Thread Starter ensemblebd

    (@ensemblebd)

    PHP Fatal error: Call to undefined function get_current_screen() in E:\www\wp-content\plugins\the-events-calendar\src\Tribe\Query.php on line 302

    when i ran the update, using the [Update Now] link, which runs the update asynchronously, and shows the spinning circle as it processes…
    It actually deleted itself from the plugins directory entirely.
    The whole folder was gone.

    I had to go to the main plugin page(here), download it manually, and upload it manually.
    Not sure if that was just a freak occurrence, but wanted to mention that, since we’re on the topic here.

    Thread Starter ensemblebd

    (@ensemblebd)

    Wonderful, thank you for the support!

    Thread Starter ensemblebd

    (@ensemblebd)

    So for anyone having this issue. Change this code:
    new Date(0)

    To this:
    new Date()

    Problem solved.

    https://stackoverflow.com/questions/30788920/javascript-date-function-abnormalities

    Thread Starter ensemblebd

    (@ensemblebd)

    The following function is causing the malfunction

    moment.js, unminified, cleaned, rewritten:

    function I(e, t, n, r) {
        var i, s, o = [];
        for (i = 0; i < 7; i++) {
            o[i] = e[i] = e[i] == null ? i === 2 ? 1 : 0 : e[i];
        }
    
    	o[7] = t;
    	e[7] = o[7];
    	if (e[8] != null) {
    		o[8] = e[8];
    	}
    	if (n) {
    		e[3]+=n;
    	} else e[3]=0;
    	if (r) {
    		e[4]+=r;
    	} else e[4]=0;
    	s = new Date(0);
    	if (t) {
    		s.setYear(e[0]);
    		s.setUTCMonth(e[1]);
    		s.setUTCDate(e[2]);
    		s.setUTCHours(e[3], e[4], e[5], e[6]);
    	} else {
    		s.setYear(e[0]);
    		s.setMonth(e[1]); // THIS ONE DOES IT.
    		s.setDate(e[2]);
    		s.setHours(e[3], e[4], e[5], e[6]);
    	}
    	s._a = o;
        return s;
    }

    So I am going to have to modify moment.js in your plugin to fix this, and stop wordpress from updating your software at this time unfortunately.

    When I whittled it down, the following code in chrome browser console reproduces the problem:

    s = new Date(0); s.setYear(2015); s
    Thu Dec 31 2015 18:00:00 GMT-0600 (Central Standard Time)
    
    s.setMonth(5); s
    Wed Jul 01 2015 18:00:00 GMT-0500 (Central Daylight Time)
    
    s.setMonth(6); s
    Wed Jul 01 2015 18:00:00 GMT-0500 (Central Daylight Time)

    Please explain that.

    Thread Starter ensemblebd

    (@ensemblebd)

    Proof that it is caused inside moment.js, which by the way is a very old version of it.
    (wp-content/plugins/all-in-one-event-calendar/public/js/external_libs/moment.js)
    This is console output. You can see that it returns the wrong date 90% of the time.

    $
    $(e, t)
    $(t="6/10/2015",n)
    Fri Jul 10 2015 00:00:00 GMT-0500 (Central Daylight Time)
    
    $(t="5/10/2015",n)
    Sun May 10 2015 00:00:00 GMT-0500 (Central Daylight Time)
    
    $(t="6/10/2015",n)
    Fri Jul 10 2015 00:00:00 GMT-0500 (Central Daylight Time)
    
    $(t="4/10/2015",n)
    Sun May 10 2015 00:00:00 GMT-0500 (Central Daylight Time)
    
    $(t="1/10/2015",n)
    Sat Jan 10 2015 00:00:00 GMT-0600 (Central Standard Time)
    
    $(t="2/10/2015",n)
    Tue Mar 10 2015 00:00:00 GMT-0500 (Central Daylight Time)
    
    $(t="02/10/2015",n)
    Tue Mar 10 2015 00:00:00 GMT-0500 (Central Daylight Time)
    
    $(t="02/10/2015",n="MM/DD/YYYY")
    Tue Mar 10 2015 00:00:00 GMT-0500 (Central Daylight Time)
    
    $(t="22/10/2015",n="MM/DD/YYYY")
    Mon Oct 10 2016 00:00:00 GMT-0500 (Central Daylight Time)
    
    $(t="00/10/2015",n="MM/DD/YYYY")
    Wed Dec 10 2014 00:00:00 GMT-0600 (Central Standard Time)
    
    $(t="01/10/2015",n="MM/DD/YYYY")
    Sat Jan 10 2015 00:00:00 GMT-0600 (Central Standard Time)
    
    $(t="02/10/2015",n="MM/DD/YYYY")
    Tue Mar 10 2015 00:00:00 GMT-0500 (Central Daylight Time)
    
    $(t="03/10/2015",n="MM/DD/YYYY")
    Tue Mar 10 2015 00:00:00 GMT-0500 (Central Daylight Time)
    Thread Starter ensemblebd

    (@ensemblebd)

    Tracked it down. You use moment.js , which converts the date string into a unix timestamp.
    And the unix timestamp is wrong.

    Whether this is your fault or moment.js fault is to be determined.
    I unminified your minified script which is injected into the loaded singular javascript file on page load. Then added some console.log to it, and began debugging.
    Below is the code altered that proves the unix timestamp returned from moment.js is WRONG by 1 month.

    y = function() {
                        var t = e("#ai1ec-start-date-input",
                                f),
                            n = e("#ai1ec-end-date-input",
                                f),
                            r = e("#ai1ec-start-time-input",
                                f),
                            i = e("#ai1ec-end-time-input",
                                f),
                            s = e("#ai1ec-has-time",
                                f)[0].checked,
                            o = t.val(),
                            a = r.val(),
                            l = n.val(),
                            c = i.val(),
                            h = "",
                            p = "",
                            d,
                            v,
                            m,
                            g = f.data("ai1ecStartTime"),
                            y = f.data("ai1ecEndTime"),
                            b = !1;
    						console.log('t: ');console.log(t);
                        typeof g == "undefined" && (g = ""),
                            typeof y == "undefined" && (y = ""),
                            d = t.data("dateFormat").toUpperCase(),
                            r.data("showMeridian") ? v = "hh:mm A" : v = "HH:mm",
                            m = d + " " + v,
                            o !== "" && (s && a !== "" ? h = u(o + " " + a,m) : h = u(o,d),
                                h = h.unix()),
                            h === "" || g !== "" && parseInt(g,
                                10) === h ? l !== "" && (s && c !== "" ? p = u(l + " " + c,
                                    m) : p = u(l,
                                    d),
                                p = p.unix(),
                                p < h && (p = h,
                                    b = !0)) : (g === "" ? g = h : g = parseInt(g,
                                    10),
                                y === "" ? y = g : y = parseInt(y,
                                    10),
                                p = h + y - g,
                                b = !0);
                        if (b) {
                            var w = u.unix(p);
                            n.val(w.format(d)).datepicker("update").datepicker("setStartDate",
                                    o),
                                s && a !== "" && i.val(w.format(v))
                        }
    					console.log('h: '+h); // INVALID TIMESTAMP 1 MONTH OFF
    					try {
    						console.log(u);// moment.js function.
    						console.log(o);// the date string. ITS VALID. Not wrong.
    						console.log(a); // unknown empty string
    						console.log(m); // the date format.
    
    						console.log('---------------------------');
    						console.log('1: '+(u(o + " " + a,m))); // timestamp 1, both identical, both wrong
    						console.log('2: '+ (u(o,d))); // timestamp 2 , both identical, both wrong
    						console.log('3: '+ (h.unix())); // null, not used, unknown.
    					}catch(e) {console.log(e);}
    
                        f.data("ai1ecStartTime",
                                h),
                            f.data("ai1ecEndTime", p)
Viewing 15 replies - 31 through 45 (of 46 total)