Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Same here. Block editor returns blank page because of JS error:

    Uncaught TypeError: Object(...) is not a function
        at Module.341 (block-library.min.js:8)
        at n (block-library.min.js:1)
        at wp.blockLibrary.0 (block-library.min.js:1)
        at block-library.min.js:1
    
    edit-post.min.js:6 Uncaught TypeError: Cannot read property 'registerCoreBlocks' of undefined
        at Module.yo (edit-post.min.js:6)
        at HTMLDocument.<anonymous> (post.php?post=19&action=edit:3555)

    Doesn’t seem to have anything to do with plugins as the files recide in: wp-includes/js/dist. (have tried disabling all plugins still error persists).

    • This reply was modified 6 years, 6 months ago by jelixir.
    Thread Starter jelixir

    (@jelixir)

    This is apparently a problem for others too:

    https://ww.wp.xz.cn/support/topic/special-characters-in-registration-form/

    When users register with special characters they can’t update their account because your method of storing their username goes awry.

    In that thread you give the same ansver that WP doesn’t allow special characters but how is that in any way relevant when it’s UM creating the username for us in the first place?? Again how should a user named “รปber รผlrik” register then? You can’t make people change their legal names to adhere to UM standards lol ๐Ÿ™‚

    • This reply was modified 7 years, 1 month ago by jelixir.
    • This reply was modified 7 years, 1 month ago by jelixir.
    Thread Starter jelixir

    (@jelixir)

    Thanks for the reply @darkfreaks! but collation doesn’t change anything.

    Also i don’t see how it would do anything? First of all the database is already created, it’a already UTF-8 and the problem isn’t that the characters are not able to be inserted, the problem is the opposite: that UM creates the username from the first and surname with characters it can’t itself validate later on, resting in the table used for plugins, namely the Usermeta table, with the key user_login.

    The normal WP backend creates a correct user_login in the Users table. I don’t get why UM creates this mangled version?

    So @ultimatemembersupport i please answer these question:

    1) Am i wrong in understanding that UM automatically creates the username from the first and surname?

    2) Why does UM not remove the special characters when creating it’s own custom user_login in the plugins table?

    3) why does UM use a custom user_meta key for storing the login in the first place, why doesn’t it just use the standard ones tha correctly has the special characters removed in the Users table in the first place?

    4) Why does the UM validation on the accounts page trip up from an already existing and uneditable field, namely the Username when the user is updating from the user accounts page?

    5) Isn’t it a normal use case the people come to the register page, put in their names with special characters and UM then creates an automatic username for them “with the special characters removed” to adhere to the WP standards .

    6) As an alternative please explain the normal step by step process a user would go through with the Register page having the name “รปber รผlrik” and no username field on the register page

    I think i have been very clear i the explanation also i have paid, so i don’t see why i don’t deserve and answer ๐Ÿ™‚

    I have used UM out of the box, no i don’t have any weird plugins. Please explain to me where i am misunderstanding something – because right now no users with special characters in either their first or surname can update their accounts page with any info because the username validation fails.

    Thanks in advance, the plugin is great otherwise!

    • This reply was modified 7 years, 1 month ago by jelixir.
    • This reply was modified 7 years, 1 month ago by jelixir.
    • This reply was modified 7 years, 1 month ago by jelixir.
    Thread Starter jelixir

    (@jelixir)

    As i wrote the user does not pick their username, it’s created automatically by UM as far as i can see. So how can you see a “your username is not valid” error when their is no username input-field?

    So what you are saying is that the “auto creation” of usernames from the register page is not standard from UM? As i wrote the user only inputs his first and surname, these off course needs to allow all characters – UM then creates a username from that which works absolutely fine in WP but not on their account page because it pulls from the plugin table usermeta.

    I am using the standard register page as far as i know: https://pastebin.com/3WMwfbyV

    I am not using any non standard plugins or validation.

    And thanks for the reply @ultimatemembersupport! ๐Ÿ™‚

    • This reply was modified 7 years, 1 month ago by jelixir.
    • This reply was modified 7 years, 1 month ago by jelixir.
    Thread Starter jelixir

    (@jelixir)

    Hi sorry the Version is : 2.0.40. (copied the wrong plugin version ).

    Here is a complete walkthrough of steps to reproduce, with images and text underneath:

    https://ww.wp.xz.cn/support/topic/error-when-users-update-their-info-um-saves-username-in-meta/#post-11404119

    • This reply was modified 7 years, 2 months ago by jelixir.
    • This reply was modified 7 years, 2 months ago by jelixir.
    Thread Starter jelixir

    (@jelixir)

    Version: Version 5.8.0-beta4

    No third party plugins for usernames.

    The user does not create his own Username.

    It is done by UM or WP automatically right out of the box right?

    I have used your standard register page with form creator.
    The user inputs his first and surname and other data. The username is then auto-created by WordPress or UM by combining the two names – special characters removed.

    As i wrote there is no problem with the usernames in WordPress, they appear in the database users table with no Umlaut and i can update just fine in the backend, – only UM shows a version with umlaut from the meta table (used nowhere else).

    It’s on the “account page” from your template that the username is displayed incorrectly. It pulls a version with special chars.

    further elaboration:

    It seems a seperate version of the username is saved in the meta table beside the correct ones auto created in the users table:

    user_login
    user_nicename

    The account template page pulls from the meta table a meta_key called:

    user_login

    which is exactly like the entries in the users table but without special chars removed – so the user can’t update his name. In the backend it works because it pulls from the users table.

    Thanks in advance ๐Ÿ™‚

    • This reply was modified 7 years, 2 months ago by jelixir.
    • This reply was modified 7 years, 2 months ago by jelixir.
    • This reply was modified 7 years, 2 months ago by jelixir.
    • This reply was modified 7 years, 2 months ago by jelixir.

    No problem. What solution do you use to hide paid content with categories?

    I have gone with a JS solution that checks each document-icon>a[href] to check if the content is in a special members folder, it then displays a lock over the thumbnail if so and links to the login page instead of the file.

    You then move to that folder with the Media Library Folders plugin, if you want the specific file to be locked.

    To avoid direct linking that folder is then login protected through the servers nginx config with a special login check php file.

    But if there is an easier solution that would be preferable..

    • This reply was modified 7 years, 6 months ago by jelixir.
    • This reply was modified 7 years, 6 months ago by jelixir.
    • This reply was modified 7 years, 6 months ago by jelixir.
    • This reply was modified 7 years, 6 months ago by jelixir.
    • This reply was modified 7 years, 6 months ago by jelixir.

    I have just created a quick hack to do this.

    From this hack a complete functionality could easily be implemented in an actual release.

    This quick hack adds a term tag to each document-icon div like:
    (yes it could properly be renamed to either terms or categories for clarity)
    The tag will then be filled with a comma separated list of terms/categories.
    <div class="document-icon" term="OneCategory, AnotherCategory"></div>

    You can then easily with JS sort your documents, or extract the data from the tag to a badge or whatever.

    Either just replace your /inc/class-document.php file with this one:
    https://pastebin.com/tWMK7eeL

    Or do the few modifications below to get an overview of what is going on.

    Plugin edit how-to:

    1 ) in the plugins folder open the file /inc/class-document.php
    2) In the constructor ( the __construct function ) add this:

    $this->terms = wp_get_post_terms( $attachment->ID,'media_category');
    $this->terms = wp_list_pluck( $this->terms, 'name' );
    $this->terms = implode ("','", $this->terms);

    Remember to change media_category to whatever your taxonomy is named if it is different from this one from Enhanced Media Library.

    3) Then in the same file edit the __tostring function to add
    $this->terms
    To the $repl array
    '%terms%',
    To the $find array
    And last add
    terms="%terms%"
    To the div tag in the $doc_icon variable

    That’s it. You now get all the appropriate categories dumped in a tag for each document.

    ___

    EDIT (dirty front end hack to display the categories):

    Dump this js to your front-end to get some tags in your document-icon div extracted from the term tag:
    (requires jquery – bootstrap used for styling here)

                $('.document-icon').each(function (i) {
                    var t = $(this);
                    var terms = t.attr('terms');
                    if (terms !== undefined) {
                        var termsArr = terms.split(',');
                        console.log(termsArr);
    				}
    				termsArr.forEach(function(v){
                        t.append('<span class="badge badge-primary">'+ v + '</span>');
    				});
                });
    • This reply was modified 7 years, 6 months ago by jelixir.
    • This reply was modified 7 years, 6 months ago by jelixir.
    • This reply was modified 7 years, 6 months ago by jelixir.
    • This reply was modified 7 years, 6 months ago by jelixir.
    • This reply was modified 7 years, 6 months ago by jelixir.
    • This reply was modified 7 years, 6 months ago by jelixir.
    • This reply was modified 7 years, 6 months ago by jelixir.

    I am very much interested in this too!

    You can already get documents with specific categories from the shortcode options , so why not in the opposite direction, i.e an option to “Include x-taxonomy for documents”, just like there is an “include description” option.

    I have also hit a wall with this …

    Thread Starter jelixir

    (@jelixir)

    .. Aaaand it was just the browser caching the old thumbnails (even though the new ones were in better quality).

    Could be remedied with versioning but that is of course maybe overkill.

    Thread Starter jelixir

    (@jelixir)

    To elaborate a bit:

    It seems the max-height on my pdf thumbnails stays at 200px – if that has anything to do with it. I know there is also a “compression quality” setting in Imagick.

    I don’t know why the settings do not take effect after changing the max dimensions ?

    Thread Starter jelixir

    (@jelixir)

    I found a solution, though through slightly obscure documentation:

    https://gist.github.com/champsupertramp/c1f6d83406e9e0425e9e98aaa36fed7d

    In this thread i just copied rkrenn’s code stub:

    add_action('um_after_account_general', 'showUMExtraFields', 100);
    
    function showUMExtraFields() {
      $id = um_user('ID');
      $output = '';
      $names = array('phone_number', 'company');
    
      $fields = array(); 
      foreach( $names as $name )
        $fields[ $name ] = UM()->builtin()->get_specific_field( $name );
      $fields = apply_filters('um_account_secure_fields', $fields, $id);
      foreach( $fields as $key => $data )
        $output .= UM()->fields()->edit_field( $key, $data );
    
      echo $output;
    }
    
    add_action('um_account_pre_update_profile', 'getUMFormData', 100);
    
    function getUMFormData(){
      $id = um_user('ID');
      $names = array('phone_number', 'company');
    
      foreach( $names as $name )
        update_user_meta( $id, $name, $_POST[$name] );
    }

    and added it above the rest of the code in the custom account.php file in your theme (like described in the previous post).

    Remember to change the $names array, and now you can have custom fields that your users can update!

    • This reply was modified 7 years, 8 months ago by jelixir.
    • This reply was modified 7 years, 8 months ago by jelixir.
Viewing 12 replies - 1 through 12 (of 12 total)