rapila / cms-base

The rapila cms’ internals. Please file all issues here if they’re not directly related to a plugin or the sample site.
http://www.rapi.la
3 stars 1 forks source link

Page tree doesn't always load #233

Open juergmessmer opened 6 years ago

juergmessmer commented 6 years ago

admin/pages/page_detail: quite frequently the page tree doesn't load, only "loading" is shown. this could relate to clear caches, to initial loading, it's also occurring after returning to pages with history back.

Note: after short testing with Safari it looks like this is a problem using Firefox. Chrome seems ok too in this respect (but page tree styles don't work properly)

relates to :jQuery 3 and jstree update

juergmessmer commented 6 years ago

Don't know what do do with this: except: when I move create element 'tree' to the first position in pages.admin.js.tmpl, the tree always seem to load (history back, first load, etc). Shall I commit this change?

juergmessmer commented 6 years ago

Looks like I found a solution f527ea8450b3976d46bea0b0c31a33eccb67d909

juergmessmer commented 6 years ago

After further tests I realized that the proposed solution doesn't work. Click on page tree item doesn't load a different page if loaded first/or something. So my solution just replaced one problem by another.

sabberworm commented 6 years ago

Which solution is less bad? We start with that and then fix the other problem.

juergmessmer commented 6 years ago

It's difficult to decide. Loading the page tree at the end is more user friendly. If the tree is not loaded you see that immediately, loading in the beginning you only find out when you want to change the page and see that nothing happens. From a user point of view the first option is less bad. Now the question is which state is easier to debug? Back to previous state?

juergmessmer commented 6 years ago

With commit a792b24afd3ed0ee9161c10095977e8f61c5c536 I tried out a new position for creating the page tree, back to the bottom of the file, but before the click handler. So far it looks like the page loading is successful now, even when loading the first time or after a history back click.

juergmessmer commented 6 years ago

A problem remains: deleting a node throws an exception: TypeError: this._tree.remove is not a function

Somehow the page_tree is not known or fully loaded when the delete callback is set in create page_detail.

Note: The page is deleted from the server, but the page_tree not reloaded

juergmessmer commented 6 years ago

Summary: (All tested Browsers)

(Firefox, NOT Safari)

juergmessmer commented 6 years ago

I moved the "independent" delete error to it's own issue #243. It might still be related.

juergmessmer commented 5 years ago

Another observation on this issue: when a admin file is changed and the cache needs to be newly written, then the page tree is not rendered, only "loading" displayed.