revig / revigniter

Framework for people who build websites using LiveCode
https://revigniter.com/
Apache License 2.0
28 stars 9 forks source link

incorrect route on scaffolding #11

Closed labrat1984 closed 4 years ago

labrat1984 commented 4 years ago

Summary

I'm experimenting with revIgniter on a local installation of LC community server. I was going to subscribe to the mailing list to ask this question, but apparently that is not operating any more. So, I decided to raise an issue here.

I've followed the examples in the user guide setting up the blog.lc controller, blogview.lc view, connecting to a local mysql database, etc.

But, when I try to implement scaffolding, there is an error. The scaffolding page appears to display correctly, but the links to edit and delete records are incorrect. The URL (displayed in the bottom of the browser when I hover over the links) reads: "localhost/blog/localhost/blog/sc1234/rigScaffEdit/1" (the record identifier at the end is correct and changes appropriately for each link). (Obviously, the "sc1234" is my scaffolding trigger code.)

As you can see, the link is erroneously duplicating "localhost/blog". I've scanned the code to find where that might be happening, but sadly, the code is too complex for me to correct it myself.

I found various places in the code where a path or route was set. I tried to correct any potential error at that location by inserting the following code:

replace "localhost/blog/localhost/blog" with "localhost/blog" in VAR

where VAR was the variable that was being set in the code. None of these efforts worked. I checked the result of each change and then, when it did not solve the problem, deleted my edit immediately. Therefore, I have made no persistent changes to the original framework pages.

Recipe to Reproduce

I assume there is some configuration error on my part. I assume that the scaffolding feature actually does work.

Versions

I am using Mac OS X 10.14, LC community server v9.5.1, revIgniter 2.1.6, a Chrome browser v 81.0, and a local instance of Apache webserver v2.4.

Additional Information

This is an impressive framework. I am eagerly learning how to use it and hope, in the future, to actually make contributions if I can.

revig commented 4 years ago

@labrat1984 thanks for the kind words. Regarding the issue: Unfortunately I am unable to reproduce your findings using the same versions of revIgniter and the LC engine. The links are composed of the settings “baseUrl” and “indexPage” concatenated with the segments of the URI. So, can you tell me your settings for “baseUrl” and “indexPage” as well as the Apache mod_rewrite rules?

labrat1984 commented 4 years ago

Thanks for your response.

My baseURL is: localhost My indexPage is:

(that's empty, per your instructions to use a "blank" indexPage if using "shortened URL's")

My rewrite rules in the .htaccess file are those you prescribe, i.e.,

RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.lc|image|img|assets|robots\.txt|css|js) RewriteRule ^(.*)$ index.lc?/$1 [L]

On Sat, Apr 25, 2020 at 7:34 AM Ralf Bitter notifications@github.com wrote:

@labrat1984 https://github.com/labrat1984 thanks for the kind words. Regarding the issue: Unfortunately I am unable to reproduce your findings using the same versions of revIgniter and the LC engine. The links are composed of the settings “baseUrl” and “indexPage” concatenated with the segments of the URI. So, can you tell me your settings for “baseUrl” and “indexPage” as well as the Apache mod_rewrite rules?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/revig/revigniter/issues/11#issuecomment-619372892, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC4IHILS22XKR4OEZAMZVN3ROLKEDANCNFSM4MQP2ECQ .

revig commented 4 years ago

There you go. Could you please add the schema to gConfig["baseUrl"] like "http://localhost/“ (assuming that localhost is document root of course)? Then please let me know what happens.

labrat1984 commented 4 years ago

That was it. Working now. The scaffolding will be a convenient way to explore the features of revIgniter. Thanks for your assistance. I hope I will be able to contribute in the future.

On Apr 25, 2020, at 5:13 PM, Ralf Bitter notifications@github.com wrote:

 There you go. Could you please add the schema to gConfig["baseUrl"] like "http://localhost/“ (assuming that localhost is document root of course)? Then please let me know what happens.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

revig commented 4 years ago

Glad it works.