Conditionally register a user based on fields

I have a Drupal 8 User registration form that has several text fields to gather information about the user.

I’d like to write a custom hook that examines the values in those fields and then either proceeds with the registration or ‘cancels’ it, like perhaps redirecting to a static page or displaying some static content.

What are the hooks I need to make this happen? Do I alter the form? Or do I hook an entity_presave function?

What do I need to do to cancel the default form processing or default entity presave/save routines?

thanks,

How to show additional SP task list fields in CQWP

I have about 3-4 SP Task lists in a site collection and I am using Content query web part to show all tasks from these task lists across the site collection. The tasks show up fine but I am only seeing one column “Task Name” as clickable URL. Can we add other columns to show up there as well? I want to show Start Date, due date, assigned to, task status, description and one custom choice column called Investor.

How can it be customized to include other fields in CQWP itself? FYI, I am working with SPonline. Thanks in advance.

Input fields – Is more user friendly for credit cards than ?

Basically this question, but with more usability focus:
https://stackoverflow.com/questions/48534229/what-is-the-correct-input-type-for-credit-card-numbers


So we have these two general keyboard layouts (at least that’s how they look on my phone).
One is <input type=number> and the other <input type=tel>

   

Now by the logic they were designed, you would use the number one for credit cards.

But I’m wondering, aren’t the buttons on <input type=tel> much easier to hit for a field where you only need numbers? It feels like all the extra symbols on <input type=number> are just cluttering the view, you can’t use them for this field anyway.

Now the questions are:
Would you consider this a better user experience, even though we’d be using the “wrong” format?
What about possible drawbacks, would this possibly hinder the user in some way?

Partial Injective Functions over Finite Fields

For a partial function $ f: X \to F_q$ , where $ X \subseteq F_q$ be a subset of a finite field $ F_q$ , is there any criterions to judge whether $ f$ is injective?

For $ X=F_q$ , since any function from $ F_q$ to $ F_q$ is a polynomial function, such topic has being discussed using the theory of permutation polynomials; Moreover, criterions only test on the cardinality of $ deg f$ and $ f(F_q)$ was given by Williams, Daqing Wan and Turnwald

For $ X\subsetneq F_q$ case, one can still discuss the problem by considering the polynomials given by Newton Interpolation Formula, is there any similar way to test the injectivity of $ f$ only by testing the cardinality of $ X$ and $ f(X)$ ?

References:

Williams, K. S., On exceptional polynomials, Can. Math. Bull. 11, 279-282 (1968). ZBL0159.05304.

Wan, Daqing, A $ p$ -adic lifting lemma and its applications to permutation polynomials, Mullen, Gary L. (ed.) et al., Finite fields, coding theory, and advances in communications and computing. Proceedings of the international conference on finite fields, coding theory, and advances in communications and computing, held at the University of Nevada, Las Vegas, USA, August 7-10, 1991. New York: Marcel Dekker, Inc. Lect. Notes Pure Appl. Math. 141, 209-216 (1993). ZBL0792.11049.

Turnwald, Gerhard, A new criterion for permutation polynomials, Finite Fields Appl. 1, No. 1, 64-82 (1995). ZBL0817.11055.

how to show 3 fields in one row in woocommerce checkout

i am doing customization of woo commerce but i want to show 3 fields in one row i have tried a lot but no success. i have paste the image of current fields

this is the image of current page

i want to shoe send amount, receive amount and provider in one row

this is the code about the custom field

    woocommerce_form_field('receive', array(  'type' => 'text', 'required' =>true,  'class' => array(  'woocommerce-input-wrapper form-row form-row-first validate-required'  ) ,  'label' => __('Receive Amount') ,  'placeholder' => __('Receive Amount') ,  ) , $  checkout->get_value('receive')); 

Adding `clone` link in view fields

I’m trying to add a clone link in view fields

Content: Clone link

and I get the column in the result, but no link, i.e. the td is empty

Any idea how to get it to display?

See attached img for more info

enter image description here

enter image description here

enter image description here

BTW: When I installed a fresh dupal with the relevant modules, I didn’t get this issue.

I get only on the production installation (and on local clone)

Adding `clone` link in view fields

I’m trying to add a clone link in view fields

Content: Clone link

and I get the column in the result, but no link, i.e. the td is empty

Any idea how to get it to display?

See attached img for more info

enter image description here

enter image description here

enter image description here

BTW: When I installed a fresh dupal with the relevant modules, I didn’t get this issue.

I get only on the production installation (and on local clone)

Automatic username generation from name fields at registration

Drupal core 8.6.5

I am trying to change the user registration process to omit the username field and generate the username from first name and last name.

Since I am new to Drupal and want to learn more I try to go without project modules for that task.

So far I set up a custom module and deactivated the username field. Now I should set a default value for it.

How can I set the username built of first name and last name before the process is going on? And strip some blancs, unallowed characters, …

My module so far:

/** * Implements hook_form_FORM_ID_alter(). */ function my_register_form_user_register_form_alter(&$ form, FormStateInterface $ form_state, $ form_id) {
$ form[‘account’][‘name’][‘#access’] = FALSE; $ form[‘account’][‘name’][‘#default_value’] =’tbd’; }

Thanks for your help!