Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Shaarli v0.12.0-beta #115

Closed
immanuelfodor opened this issue Aug 30, 2020 · 23 comments
Closed

Compatibility with Shaarli v0.12.0-beta #115

immanuelfodor opened this issue Aug 30, 2020 · 23 comments
Labels

Comments

@immanuelfodor
Copy link

Hi @kalvn,

According to shaarli/Shaarli#1511 we need to check and maybe update our plugins and themes to stay compatible with the changes in Shaarli's routing and templating. After upgrading Shaarli to latest master, nothing is displayed on the UI, a blank page is shown as the Material theme is not yet updated. Could you please look into the changes and fix the new errors caused by the refactoring?

The docker logs for the first fatal error that stop the page from rendering:

shaarli    | 2020/08/30 08:13:21 [error] 11#11: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function isLoggedIn() in /var/www/shaarli/tmp/includes.c04e6db3e3da5484d981ebaa00b75abc.rtpl.php:82
shaarli    | Stack trace:
shaarli    | #0 /var/www/shaarli/inc/rain.tpl.class.php(175): include()
shaarli    | #1 /var/www/shaarli/tmp/error.025e4ef3c23e9ff6918934cf9db5d80e.rtpl.php(4): RainTPL->draw('./includes')
shaarli    | #2 /var/www/shaarli/inc/rain.tpl.class.php(190): include('/var/www/shaarl...')
shaarli    | #3 /var/www/shaarli/application/render/PageBuilder.php(237): RainTPL->draw('error', true)
shaarli    | #4 /var/www/shaarli/application/front/controller/visitor/ShaarliVisitorController.php(66): Shaarli\Render\PageBuilder->render('error', '')
shaarli    | #5 /var/www/shaarli/application/front/controller/visitor/ErrorController.php(43): Shaarli\Front\Controller\Visitor\ShaarliVisitorController->render('error')
shaarli    | #6 [internal function]: Shaarli\Front\Controller\Visitor\ErrorController->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Error))
shaarli    | #7 /var/www/shaarli/vendor/slim/slim/Slim/App.php(728): call_" while reading response header from upstream, client: 192.168.1.3, server: , request: "GET /? HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "shaarli.local", referrer: "https://shaarli.local/?9qeqtA"
shaarli    | 192.168.1.3 - shaarli [30/Aug/2020:08:13:21 +0000] "GET /? HTTP/1.1" 500 2660 "https://shaarli.local/?9qeqtA" "Mozilla/5.0 ..."

@kalvn
Copy link
Owner

kalvn commented Aug 30, 2020

Hi @immanuelfodor,
Yes I definitely need to take some time to update the theme, I'll try to take a look either today or during the coming week, at least to make it work with the latest master from Shaarli. I'll keep you updated :)

@kalvn kalvn added the in dev label Aug 30, 2020
@ArthurHoaro
Copy link

@kalvn Let me know if I can help.

@kalvn
Copy link
Owner

kalvn commented Aug 31, 2020

@ArthurHoaro thanks! Actually I have a question: do you know if there's a way to retrieve the current URL path ($_SERVER['REQUEST_URI']) from templates?

I tried to access the $_SERVER variable from within templates but it cause errors (on contrary to $_GET which works fine). I need this to highlight current page in the tag.sort.html file.

@ArthurHoaro
Copy link

It's not exactly what you asked for, but you could use {$_PAGE_} which could fit your use case and are also used by plugins. However I need to fix an unnecessary breaking change in these values, as mentioned in the other thread.

@kalvn
Copy link
Owner

kalvn commented Sep 1, 2020

The branch support-v012 was just finalized. I tested it pretty intensively with Shaarli v0.12.0-beta and found no issues so far. I didn't create a release yet but if anyone wants to do some test on his side, I would greatly appreciate :)

I'll keep testing for a few days on my own and release it when Shaarli v0.12.0 is released.

@immanuelfodor
Copy link
Author

Did a git checkout to the new branch, works fine, looks awesome 🎉

However, I can't login at all after a logout. It seems to be a general Shaarli issue @ArthurHoaro on the master branch as the docker image was built from scratch. Deleted ipbans file, did a browser cache delete, used a different browser, nothing helped.

@immanuelfodor
Copy link
Author

I can't login even with the default template, this is an important info I think. The login redirect seems to be weird:

shaarli    | 192.168.1.3 - shaarli [02/Sep/2020:02:59:11 +0000] "POST /login?returnurl=%2F HTTP/1.1" 302 0 "https://shaarli.local/login?returnurl=%2F" "Mozilla/5.0...
shaarli    | 192.168.1.3 - shaarli [02/Sep/2020:02:59:11 +0000] "GET /login?returnurl=%2Flogin%3Freturnurl%3D%252F HTTP/1.1" 200 12197 "-" "Mozilla/5.0... 

@immanuelfodor
Copy link
Author

immanuelfodor commented Sep 2, 2020

Maybe shaarli/Shaarli#1536 needs to be merged quick 😃

Edit: the force login false trick helped to get finally in.

@immanuelfodor
Copy link
Author

When editing a share on mobile, the FAB is shown and it is out of place:

Screenshot_20200902-052149

@ArthurHoaro
Copy link

@immanuelfodor I merged shaarli/Shaarli#1536, it should fix the issue you had previously.

@ArthurHoaro
Copy link

The branch support-v012 was just finalized

@kalvn Awesome! You rule!

@kalvn
Copy link
Owner

kalvn commented Sep 3, 2020

@kalvn
Copy link
Owner

kalvn commented Sep 5, 2020

It's fixed with the last commit.

@immanuelfodor
Copy link
Author

Tested with the latest support-v012 branch, it's fixed, thanks! :)

@immanuelfodor
Copy link
Author

immanuelfodor commented Sep 5, 2020

Hmm, I think I've found another bug: the CSS/JS resources are loaded without / at the beginning of the URL, so it becomes /admin/shaare/plugins/markdown_toolbar/includes/bootstrap_markdown/js/bootstrap-markdown.js for example which breaks the edit/add page resources as these are now requested from a folder too deep:

image

These weren't 404 URLs 4 days ago, so something must broke in the meantime.

@immanuelfodor
Copy link
Author

immanuelfodor commented Sep 5, 2020

Or maybe Shaarli:master introduced a change that results in PluginManager::$PLUGINS_PATH becoming "slash-less"? 😀 @ArthurHoaro

@kalvn
Copy link
Owner

kalvn commented Sep 5, 2020

I think it's not related to Shaarli Material.

I would say plugin developers must ensure external resources are added with the base path, as it's done here for example: https://github.com/kalvn/shaarli2mastodon/blob/master/shaarli2mastodon.php#L75

@immanuelfodor
Copy link
Author

Wow, thanks for the example, I'm adding this to my plugins. Sorry for suspecting a bug here.

@kalvn
Copy link
Owner

kalvn commented Sep 5, 2020

@ArthurHoaro
Copy link

Just to give a little more info about why:

  • we don't know if Shaarli is installed under a subfolder or not, so we can't use '/' . PluginManager::$PLUGINS_PATH
  • before v0.12 every route were on the same folder level (domain.tld/shaarli/?do=route), so relative path worked fine. Now routes can be on multiple levels (e.g. /daily and /admin/* routes), so it requires to manually set the absolute path.

@immanuelfodor
Copy link
Author

Thanks for the insights! Based on this knowledge I also opened a shaarli-favicons PR to fix the same issue, shaaring is caring :) trailjeep/shaarli-favicons#3

@immanuelfodor
Copy link
Author

shaarli/Shaarli#1558 happened in the meantime, so I'll also revert any related changes. @kalvn said in shaarli/Shaarli#1548 (comment) that Shaarli Material has been also updated accordingly, so I think this ticket can be closed finally.

@immanuelfodor
Copy link
Author

Updated all my plugins, they now work according to PR shaarli/Shaarli#1558 Also shaarli/Shaarli#1545 works fine with the theme. I think the support-v012 branch here can be also closed, it's up-to-date with master. Thank you all for being supportive over the years! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants