Forum Replies Created

Viewing 9 replies - 91 through 99 (of 99 total)
  • Yes, same here. They aren’t synced. I need help here too. This attribute sync issue is a bitter problem. We now turned off this plugin and doing this setting up of attributes for other languages manually and hoping for a better days to come. ??

    Yeah in the target link I’ve posted temporary solution that skips 301 check. Because in ngg it would take another night to analyse the code and see where that double slash is generated as well maybe the fix would be wrong, unless I’d test in multiple different scenarios, which would take another nights ?? lol

    @mjakop, this is what those changes do for me: https://img.ctrlv.in/img/15/07/06/559a833bd0e98.png

    Don’t know where you took that from but template_redirect is not in PLL_Frontend_Links model.

    P.S. If you follow the link to gallery in albums, result is: “no images found”. What I do is set: $redirect_url = $requested_url;

    To skip this check:

    if ($do_redirect && $redirect_url && $requested_url != $redirect_url) {
    			wp_redirect($redirect_url, 301);
    			exit;
    		}

    its not global so no harm done, unless the $requested_url doesnt exist anymore for real.

    P.S. In my optinion 404 would be better instead of 301, or at least 303. If language doesn’t exist then redirect to something that exists (Something with no language or default one, should surely exist, it 100% more valid to look at some information, than to and information that makes you stressed). If wordpress data wasn’t serialised I would suggest looking up slug with LIKE %first_4_letter_of_slug%, but now, I know not how to do it with serialised data. ?? Thanks for attention ??

    OKay, so problem all the time was redirect to 301, because redirecte_url and requested_url do not match in

    F:\xampp\htdocs\lietkabelis.tk\wp-content\plugins\polylang\frontend\frontend-links.php:after:538

    If I set: $redirect_url = $requested_url; Then everything works. But I wonder why do they become not equal in the first place. :wondering:

    Well guess parsed params are sent to polylang, which then replies if post in current language is found then it loads it if not it doesn’t. Guess its caused by this problem, as there is no language link between polylang and ngg_gallery. So how to make polylang ignore ngg_gallery, well not to precess requests to ngg_gallery.

    UPDATE: Sorry that wasn’t the function, was var_dumping wrong var.
    Here is the function:

    wp-content\plugins\nextgen-gallery\products\photocrati_nextgen\modules\router\package.module.router.php:526

    public function serve_request()
        {
            $served = FALSE;
            // ensure that the routing patterns array exists
            if (!is_array($this->object->_routing_patterns)) {
                $this->object->_routing_patterns = array();
            }
            // if the application root matches, then we'll try to route the request
            if ($request_uri = $this->object->get_app_request_uri()) {
                // Perform URL rewrites
                $redirect = $this->object->do_rewrites($request_uri);
                // Are we to perform a redirect?
                if ($redirect) {
                    $this->object->execute_route_handler($this->object->parse_route_handler($redirect));
                } else {
                    foreach ($this->object->_routing_patterns as $pattern => $handler) {
                        if (preg_match($pattern, $this->object->get_app_request_uri(), $matches)) {
                            $served = TRUE;
                            // Add placeholder parameters
                            foreach ($matches as $key => $value) {
                                if (is_numeric($key)) {
                                    continue;
                                }
                                $this->object->set_parameter_value($key, $value, NULL);
                            }
                            // If a handler is attached to the route, execute it. A
                            // handler can be
                            // - FALSE, meaning don't do any post-processing to the route
                            // - A string, such as controller#action
                            // - An array: array(
                            //   'controller' => 'I_Test_Controller',
                            //   'action'	  => 'index',
                            //   'context'	  => 'all', (optional)
                            //   'method'	  => array('GET') (optional)
                            // )
                            if ($handler && ($handler = $this->object->parse_route_handler($handler))) {
                                // Is this handler for the current HTTP request method?
                                if (isset($handler['method'])) {
                                    if (!is_array($handler['method'])) {
                                        $handler['$method'] = array($handler['method']);
                                    }
                                    if (in_array($this->object->get_router()->get_request_method(), $handler['method'])) {
                                        $this->object->execute_route_handler($handler);
                                    }
                                } else {
                                    $this->object->execute_route_handler($handler);
                                }
                            } else {
                                if (!$handler) {
                                    $this->object->passthru();
                                }
                            }
                        }
                    }
                }
            }
            exit(var_dump($this->object));
            return $served;
        }

    After that _request_uri att becomes false, while before it was full requested url. Here is the var_dump:

    object(C_Routing_App)[421]
      public '_request_uri' => boolean false
      public '_settings' =>
        object(stdClass)[422]
          public 'router_param_separator' => string '--' (length=2)
          public 'router_param_slug' => string 'galerija' (length=8)
          public 'router_param_prefix' => string '' (length=0)
      public 'context' => string '/photocrati_ajax' (length=16)
      public 'adapted' => boolean true
      public '_mixins' =>
        array (size=8)
          'Mixin_Url_Manipulation' => null
          'Mixin_Routing_App' =>
            object(Mixin_Routing_App)[416]
              public 'object' =>
                &object(C_Routing_App)[421]
              public 'method_called' => null
          'A_I18N_Routing_App' => null
          'A_WordPress_Routing_App' => null
          'A_NextGen_Basic_Gallery_Urls' => null
          'A_NextGen_Basic_ImageBrowser_Urls' => null
          'A_NextGen_Basic_TagCloud_Urls' => null
          'A_NextGen_Basic_Album_Urls' => null
      public '_mixin_priorities' =>
        array (size=8)
          0 => string 'A_NextGen_Basic_Album_Urls' (length=26)
          1 => string 'A_NextGen_Basic_TagCloud_Urls' (length=29)
          2 => string 'A_NextGen_Basic_ImageBrowser_Urls' (length=33)
          3 => string 'A_NextGen_Basic_Gallery_Urls' (length=28)
          4 => string 'A_WordPress_Routing_App' (length=23)
          5 => string 'A_I18N_Routing_App' (length=18)
          6 => string 'Mixin_Routing_App' (length=17)
          7 => string 'Mixin_Url_Manipulation' (length=22)
      public '_method_map_cache' =>
        array (size=6)
          'route' => string 'Mixin_Routing_App' (length=17)
          '_route_to_regex' => string 'Mixin_Routing_App' (length=17)
          'serve_request' => string 'Mixin_Routing_App' (length=17)
          'get_app_request_uri' => string 'Mixin_Routing_App' (length=17)
          'does_app_serve_request' => string 'Mixin_Routing_App' (length=17)
          'get_router' => string 'Mixin_Routing_App' (length=17)
      public '_disabled_map' =>
        array (size=0)
          empty
      public '_interfaces' =>
        array (size=2)
          0 => string 'I_Component' (length=11)
          1 => string 'I_Routing_App' (length=13)
      public '_throw_error' => boolean true
      public '_wrapped_instance' => boolean false
      public 'object' =>
        &object(C_Routing_App)[421]
      public '_routing_patterns' =>
        array (size=1)
          '#^(/)(galerija/)?(/?([^/]+\-\-)?[^/]+\-\-[^/]+/?){0,}/?$#i' => string 'I_Ajax_Controller#index' (length=23)

    UPDATE:
    Okay in my case I have this url https://www.kklietkabelis.tk//pramogos/nuotrauku-galerija/ this is directory to page with album shortcode. Then: galerija/lietkabelis-zalgiris is the other part of the link to specific gallery. While galerija is a slug for ngg_gallery and “lietkabelis-zalgiris”, is slug for specific gallery. And in var_dump of $retval, I can’t find “lietkabelis-zalgiris”.

    Seems that params are removed with javascript or some preprocessor, because I put echo $_SERVER[‘REQUEST_URI’]; to album shortcode page and doesn’t matter if I request /pramogos/nuotrauku-galerija/galerija/lietkabelis-zalgiris ir returns only /pramogos/nuotrauku-galerija/.

    Found the function which causes this:

    wp-content\plugins\nextgen-gallery\products\photocrati_nextgen\modules\router\package.module.router.php:206

    public function get_request_uri($with_params = TRUE)
        {
            if (!empty($_SERVER['ORIG_REQUEST_URI'])) {
                $retval = $_SERVER['ORIG_REQUEST_URI'];
            } elseif (!empty($_SERVER['PATH_INFO'])) {
                $retval = $_SERVER['PATH_INFO'];
            } else {
                $retval = $_SERVER['REQUEST_URI'];
            }
    
            exit(var_dump($retval));
            // Remove the querystring
            if (($index = strpos($retval, '?')) !== FALSE) {
                $retval = substr($retval, 0, $index);
            }
            // Remove the router's context
            $retval = preg_replace('#^' . preg_quote($this->object->context, '#') . '#', '', $retval);
            // Remove the params
            if (!$with_params) {
                $retval = $this->object->strip_param_segments($retval);
            }
            // Ensure that request uri starts with a slash
            if (strpos($retval, '/') !== 0) {
                $retval = "/{$retval}";
            }
            return $retval;
        }

    UPDATE:
    I’ve changed permalinks to default the ugly ones, with get params. And now I can see, that it uses in all links smae page_id as I’m in now. For some reason it is not generating gallery page id. Ah but figured out that ngg is using separate url parser. Because it has no effect on WordPress permalink changes.

    Okay with phpstorm debuging and xdebug, I figured out, that as response to url request Initiator: which is the target link, on response I get
    301 Moved Permanently and as result same page request was made from is reloaded. Still looking for where request url is parsed and gallery id is parsed from url or gallery is requested from mysql with a gallery slug.

    breakpointing:

    \wp-content\plugins\nextgen-gallery\products\photocrati_nextgen\modules\router\package.module.router.php:978

    public function get_formatted_querystring()
        {
    <breakpoint here>        $retval = '/' . $this->object->get_router()->get_querystring();
            $settings = $this->object->_settings;
            $retval = str_replace(array('&', '='), array('/', $settings->router_param_separator), $retval);
            return $retval;
    
        }

    Dang, thats sux. Okay, lets say I don’t want ngg_translation. But I at least want polylang not to break links to galleries in ngg gallery album. You can checkout the problem over here: https://www.kklietkabelis.tk/pramogos/nuotrauku-galerija/. Try to go to any gallery and it will fail… :-(, no errors or etc. I think its somekind of redirect taking action, maybe header or so on. Don’t even know where to start looking at…

    Please this was 7 month ago, maybe during this months something has changed?

    P.S. Always using borth latest. Always up to date so check with latest versions. qTranslate is doesn’t work with 4.2.2 WordPress, so its out of the question. ??

    P.P.S. Can’t escape ngg, because of album option and possibility to display whole album. Wish there was alternative I could migrate with few clicks to from ngg which would be compatible with latest wordpress and polylang.

Viewing 9 replies - 91 through 99 (of 99 total)