• Resolved jmarx75

    (@jmarx75)


    Hello,
    When upgrading to the latest version(2.4.1) and using a custom implementation, I noticed in this version you are no longer allowing ap queries to work on custom pages without selecting the pages in your settings section.
    That’s cool. The only problem is that when you actually select a page, it doesn’t appear to be saving to my wp_options table correctly.
    When I save a page(s) I look at my db and see the ap_allowed_pages option I do see one page ID saved in there(despite the fact that I entered in several). And when I navigate to that custom page, the query does not work. I noticed on line 745 in inc/functions.php , I see that you are grabbing the option to see if it’s an allowed page. The problem is that the code on line 746 is expecting an array of IDs of allowed pages, but the actual option returned is a string. So even if you do save a page, the functionality breaks when you try and retrieve it. Does that make sense? So in essence, the ability to select a custom page does not work at all. It seems like when saving the option on line 187, $_REQUEST['ap_allowed_pages'] needs to be converted to an array before you save it or the data saved is not at all helpful when outputting it on the front end. Can you take a look at this?

    https://www.ads-software.com/plugins/alphabetic-pagination/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Hi,

    Yes, it does make sense. In fact, custom implementation is a premium feature and when the required file will be included so instead of string, it will get a valid array in return. It works fine once you upgrade to pro version. I appreciate your efforts to find the reason behind this. But in PHP we mostly don’t care about variable type casting. If its string at the moment so it can be converted to an array later.

    P.S. Auto implementation is encouraged in FREE version.

    Thanks,
    Fahad

    Thread Starter jmarx75

    (@jmarx75)

    Thanks for the response!

    Well if u have the list of pages available on the free version, you should be a to select them or that functionality is broken right? Or at there should be a ‘select all’ option at the very least. Right now, you can’t select any pages and the interface suggests that you can. So that’s where it’s more problematic in my mind and making the change to simply save that option as an arrAy is something that should be fine. Or don’t have an is_array check on the other side of you’re outputting a string. That just makes the free version broken. Not trying to be confrontational
    But it’s definitely not working as intended by the interface.

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Great, i have updated the plugin with is_array() thing and also when someone will click on custom so he will see a text “Premium Feature” under allowed pages.

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Mentioned your username in changelog as well
    https://www.ads-software.com/plugins/alphabetic-pagination/changelog/

    Thread Starter jmarx75

    (@jmarx75)

    Sorry, but the problem here is that you are now taking something away that was offered previously. You know? We have been able to use custom pages up to this point. So I am just asking/begging you to consider making this simple change on line 187 of /inc/functions.php
    from
    update_option( 'ap_allowed_pages', $_REQUEST['ap_allowed_pages'] );
    to :
    update_option( 'ap_allowed_pages', array( $_REQUEST['ap_allowed_pages'] ) );

    This was working for months and months and now it’s broken, so I’m hoping you can make this simple change so we can maintain functionality we previously had.

    Thanks for your attention and responses.

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    I would suggest you to make this patch for your personal copy, i will keep this feature as premium one. Thanks for reporting this bug.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Allowed pages option not saving properly’ is closed to new replies.