Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 07:10 am EDT

Geeklog Forums

URL Routing bug?


Status: offline

alb3rt

Forum User
Regular Poster
Registered: 10/30/06
Posts: 71
Location:Mexico City
Hi guys,

I enabled url routing in my new site, this works fine but I found a little error. The variable {edit_url} it is empty when you read full article, for example:

http://site.net/article/my-article

Even with "root" user. In the file ~system/lib-article.php line 571 I find:

Text Formatted Code

        if (($index != 'p') && SEC_hasRights('story.edit') &&
            ($story->checkAccess() == 3) &&
            (TOPIC_hasMultiTopicAccess('article', $story->DisplayElements('sid')) == 3)
        ) { ...
 


The conditions are not met ( SEC_hasRights = empty, $story->checkAccess = 2, TOPIC_hasMultiTopicAccess = 2).

Can it be a bug? I can't find a way to enable the edit-url button with the url routing enabled. I insist, this happens when you read full article.

Best regards
D Web Studio - www.d-webstudio.net
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
Sounds like a bug. I added a report on GitHub: https://github.com/Geeklog-Core/geeklog/issues/932

I will look into this early this coming week.
One of the Geeklog Core Developers.
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
Does the article edit icon work in the topic view?

I've tested it on my system and it works fine with URL Routing and Rewrite enabled.

Since the article is being returned it looks like your url variables are being read fine.

Are you sure you are accessing the article logged in as a root user or one that has story edit rights?

Text Formatted Code
SEC_hasRights('story.edit')
should return true

The other functions will return 3 for read/edit, 2 for read only, 0 for no access

One of the Geeklog Core Developers.
 Quote

Status: offline

alb3rt

Forum User
Regular Poster
Registered: 10/30/06
Posts: 71
Location:Mexico City
Hi Tom,

I have made sure to be connected as Root and I have done many tests and the same thing happens.

I have set up a demo site on another server (on bluehost), on this site it does not disappear {edit_url}, however, other things happen, look at these links (it's the same article)

URL without "routing"
http://demo.geeklog-hispano.net/article.php?story=welcome

URL with "routing"
http://demo.geeklog-hispano.net/article/welcome

However they do not look the same (differences in the blocks, icons in the news, breadcrumbs, etc).

The difference in servers is that this runs php7.0 and my local server (the one that does not appear url_edit) runs php7.2
D Web Studio - www.d-webstudio.net
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
Thanks for setting up the demo examples.

Yeah the URL with routing demo site you setup is just showing the homepage and not the full article which is what the url is pointing too. This seems to suggest that Geeklog did not find the article id in the url so it did not know what to display.

I just want to make sure we have all the basics covered. Yo do have an htaccess file setup for url routing correct? (as per https://www.geeklog.net/docs/english/config.html#url-routing)

The other thing it could be is a PHP 7.2 compatibility issue (there are some with Geeklog 2.2.0 that are fixed in the next version of Geeklog that has yet to be released). Can you change that demo site to use PHP 7.1 or lower version and test?
One of the Geeklog Core Developers.
 Quote

Status: offline

alb3rt

Forum User
Regular Poster
Registered: 10/30/06
Posts: 71
Location:Mexico City
Hi Tom,

What OS do you use for testing? I enabled a virtual machine with ubuntu server 16.04 + php 7.0 (FPM/FastCGI) y MariaDB but I can't run "rewrite" correctly.

Kind regards
D Web Studio - www.d-webstudio.net
 Quote

Status: offline

alb3rt

Forum User
Regular Poster
Registered: 10/30/06
Posts: 71
Location:Mexico City
I have duplicated the error, I posted it on github
D Web Studio - www.d-webstudio.net
 Quote

Status: offline

alb3rt

Forum User
Regular Poster
Registered: 10/30/06
Posts: 71
Location:Mexico City
FINALLY I solved my mistake and I describe it below in case someone happens something.

I have 2 pc (1 server and 1 pc-development, the server in addition to apache runs a server dns (bind) in which I configure my different subdomains.

My subdomain demo.dws.mx runs on the server and is also listed in the dns (demo.dws.mx -> 192.168.1.101), works correctly.

My subdomain demo2.dws.mx run in with virtualbox and it exists in my real server (demo2.dws.mx -> 192.168.1.102). I get 404 error

My pc-development gets the names from the dns (server) therefore both sites are shown, however my server mounted in virtualbox does not get the names from the real server, so it never finds the site demo2.dws.mx and therefore it returns error 404, the solution is to add (in server virtualbox):

Text Formatted Code
/etc/hosts

192.168.1.102 demo2.dws.mx


Finally, the error that started this post is that when you login to the site from:
Text Formatted Code
mysite.com/admin/


Does not set the cookie "password" which causes the error described in my first post. I do not know if this was programmed in this way or if there is a bug here, but everything is resolved if I login from

Text Formatted Code
mysite.com.com/users.php


Or using the "My account" block.

Tom, thank you for your patience.
D Web Studio - www.d-webstudio.net
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
Thanks for the update.
One of the Geeklog Core Developers.
 Quote

All times are EDT. The time is now 07:10 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content