Comments (8)
Hi @sanderdekroon,
thanks for your report!
I don't think that this is related to the jQuery no-conflict mode, as we would be seeing a different error message then. Also, TablePress protects against that by setting the $()
function via the global jQuery
object coming in as a function parameter.
Instead, it seems that the "Table Features for Site Visitors" section is not properly loaded on this page. Do you see this section on your "Edit" screen?
I actually had added some code to fix this problem in TablePress 2.0.1, via https://github.com/TablePress/TablePress/blob/2.0.1/classes/class-controller.php#L138-L145
Maybe that somehow did not work for your user account.
To verify this: Can you maybe check if this issues happens with a completely new WordPress user?
Thanks!
Tobias
from tablepress.
Thank you for your swift response :)
I've tried your suggestion by doing the following actions:
- I updated TablePress from 1.14 to 2.0.2 with my admin account
- I verified the error was still occurring (it was)
- I created a new admin account and switched to it
- I visited the edit page and the error is still occurring
I do not see a section labeled "Table Features for Site Visitors". The only sections are "Table Information", "Table Content", "Table Manipulation" and "Table Options".
The main admin account is also missing some user options like closedpostboxes_tablepress_edit
and metaboxhidden_tablepress_edit
. The new account however does have those options, although they are set to an empty array. Though I'm not sure how much impact these options have.
from tablepress.
Hi @sanderdekroon,
thanks for trying all this! It's strange the the deletion of all those user options is not working for you...
It's even stranger that the newly created account shows this problem, because it shouldn't have these set...
If possible, I'd like to take a direct look at this on your site. Could you therefore please get in touch via email (the address is on https://tablepress.org/impressum/ )? That way, I can investigate this directly. Thanks!
Regards,
Tobias
from tablepress.
Talking about user options made me think of capabilities and well.. let's just say some parts of our back-end have been dumbed down to prevent issues with less tech-savvy users. This means the "Table Features for Site Visitors" metabox is removed for every user. We do this because of reasons I will not bore you with.
In short: restoring the metabox resolved the issue! I'm sorry for wasting your time with this issue 🙇♂️
Though I was wondering if you might know a way to disable the options in the Features metabox by default? I've found the tablepress_table_template
filter to set the default options new tables. But I have not yet found a way to set those options to false for existing tables.
from tablepress.
Hi @sanderdekroon,
ah, indeed, that explains it. That metabox must be present in the DOM, as the JS and the saving process will not work otherwise.
Right now, I can't think of a good way to properly hide this (I've looked into this, but only discovered a "rabbit hole" that I described in a Trac ticket (see https://core.trac.wordpress.org/ticket/17370#comment:6 ).
How have you been hiding this metabox? Maybe that will give me some inspiration?
Indeed, tablepress_table_template
"only" defines the default values. To override changes that a user made, you can set the corresponding value in the Shortcode parameters (or the "Configuration parameters" field of the new "TablePress table" editor block), or (if users can edit posts and pages) even a step "later" via the tablepress_render_options
filter hook, see https://github.com/TablePress/TablePress/blob/2.0.2/controllers/controller-frontend.php#L617-L627 .
Regards,
Tobias
from tablepress.
We've been removing it with a remove_meta_box
function call. Specifically: remove_meta_box('tablepress_edit-datatables-features', null, 'normal');
Instead of removing the metabox, would it be possible to make the options disabled and use the default value set through the tablepress_table_template
filter?
I don't have a working solution yet, but I was think along the lines of doing an additional check in the tp.helpers.options.load
function. For example, disabling the inputs that are present in the tp.table.disabled_options
object. This object would be empty by default, but is editable through a filter.
from tablepress.
Hi @sanderdekroon,
thanks for the example! Yes, this will not work as the fields are then not in the DOM.
How about instead simply hiding the meta box with some CSS code? This should be the easiest.
Something like
#tablepress_edit-datatables-features {
display: none !important;
}
could be sufficient already.
The TablePress Extension from https://tablepress.org/extensions/input-field-size/ shows how to add CSS code to the "Edit" screen (but ignore the CSS that's in there right now, I haven't updated that for TablePress 2.0 yet).
Best wishes,
Tobias
from tablepress.
Hi @sanderdekroon,
I believe that we can close this, as we have found the reason for this problem and a possible solution.
If anything is still not right, please feel free to reopen with more details.
Thanks!
Tobias
from tablepress.
Related Issues (20)
- Table cross the maximum size of template HOT 1
- Lesbarkeit von Beiträgen (Yoast SEO) wird durch einfügen der Tabelle von Gut auf OK runtergestuft HOT 2
- Question: posibility to get table information from a json REST api, instead of importing? HOT 4
- Can't save Auto Import Tables config HOT 1
- Function WP_Block_Type_Registry::register was called incorrectly HOT 2
- tablepress_rest_api:missing_capability:tablepress_edit_table HOT 7
- Help with translation HOT 3
- Freemius integration is doing heavy damage to wp_sitemeta meta_key fs_accounts HOT 5
- aria-role="link" in previous/next-buttons is redundant HOT 4
- check if file exists before attempting to unlink HOT 2
- Freemius Performance issue after upgrading to 2.1.5 HOT 3
- Error: Function is_search was called incorrectly... HOT 4
- Change Default Table Features for Site Visitors HOT 1
- No obvious way to disable/revert inline CSS loading HOT 1
- Fatal error: Compatibility issue with FS Edd Migration plugin HOT 8
- Resolve PHPStan issues HOT 12
- Oops! That page can’t be found. HOT 3
- Question: Accent neutralise HOT 1
- Tablepress text gets white when add links HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tablepress.