Print custom field in user edit form in block

Following code prints user edit form in block:

function notifikacie_custom_block_info() {  $  blocks['user_profile'] = array(    'info' => t('User profile edit'),    'cache' => DRUPAL_NO_CACHE,  );   return $  blocks; }  function notifikacie_custom_block_view($  delta = '') {   $  block = array();        global $  user;       module_load_include('inc', 'user', 'user.pages');       $  block['subject'] = t('Fill your profile');       $  block['content'] = drupal_get_form('user_profile_form', $  user);    return $  block; } 

But it does not print custom fields created in admin/config/people/accounts/fields. How do I print those custom fields?

How to create a confirm popup when delete item with field collection?

I have configured a field collection field (unlimited items) for a content type and I want create a confirm popup when user delete an item. For this, i found that i can directly go and modify 2 functions in the field_collection.pages.inc file. They are:

1. field_collection_item_delete_confirm

2. field_collection_item_delete_confirm_submit

I’m a newbie in drupal so I don’t know how to use these function from the field_collection.pages.inc file, I tried to hook these function in template.tpl file but it’s didn’t work. Can someone help me ? Sorry about my English.

What is known about the common knowledge of mathematicians outside their field?

When giving a talk or writing a paper intended for non-specialist (i.e., mathematicians not specializing in the topic being discussed), the question inevitably occurs of what one can assume to be “common knowledge”. Rather than trying to guess (e.g., I assume that almost all mathematicians know what a vector space over a field and what the Lebesgue measure are), it would probably be better to determine this experimentally. Have any surveys been conducted in order to answer this question?

Roughly which set of mathematical definitions and facts are known to a proportion at least $ p$ of working mathematicians?

(Here, $ \frac{1}{2}\leq p<1$ is some fixed but specified quantity. Of course, a survey like this would in fact measure how well-known various notions and theorems are, so would give results for a variety of different $ p$ . Also of course, this depends on some definition of what a “working mathematician” is, I’m assuming self-reporting as such, but I don’t think the details are too important; even a survey limited to a particular country or membership to a particular mathematical society would be something.)

It seems to me that this would be interesting both mathematically (see above) and sociologically. More refined results indicating how results vary per country, per age group, or per specialty, would of course be of value, but any survey along these lines would interest me.

I tried Googling various terms to no avail, so I’m inclined to think that no such survey was ever conducted, but maybe I missed something.

Erro no ObjectBox (Cause: no such field: $1/__boxStore)

Galera é o seguinte, fiz duas classes em java para herdar de Item (classe abstrata), Filme e Serie. Estou utilizando como banco de dados o ObjectBox. Toda vez que coloco o app pra executar aparece esse erro:

Cause: no such field: $  1/__boxStore 

Classe Item:

@Enity public abstract class Item{     @Id     private long id;     private String titulo;     private String genero;     private int ano;     private String sinopse;     private String estrelando;     private List<Comentario> comentarios;     private ToOne<Usuario> usuario;     private List<Temporada> temporadas;     //getters e setters } 

Classe Filme:

@Entity public class Filme extends Item{      public Filme(String titulo, String genero, int ano, String sinopse, String estrelando) {     super(titulo, genero, ano, sinopse, estrelando); } 

}

Classe Serie:

@Entity public class Serie extends Item {      public Serie(String titulo, String genero, int ano, String sinopse, String estrelando) {     super(titulo, genero, ano, sinopse, estrelando); } 

}

Link do Projeto: Clique aqui (As classes estão em java e o resto do projeto em Kotlin)

Desde já obrigado.

How can I leave comment Subject as blank when fill nothing in the subject field?

When we fill nothing in the subject field of comment, drupal will use the comment body as the value of subject. See the code in CommentForm::buildEntity

// Validate the comment's subject. If not specified, extract from comment // body. if (trim($  comment->getSubject()) == '') {   if ($  comment->hasField('comment_body')) {     // The body may be in any format, so:     // 1) Filter it into HTML     // 2) Strip out all HTML tags     // 3) Convert entities back to plain-text.     $  comment_text = $  comment->comment_body->processed;     $  comment->setSubject(Unicode::truncate(trim(Html::decodeEntities(strip_tags($  comment_text))), 29, TRUE, TRUE));   }   // Edge cases where the comment body is populated only by HTML tags will   // require a default subject.   if ($  comment->getSubject() == '') {     $  comment->setSubject($  this->t('(No subject)'));   } } 

I still need to show Subject if it’s been filled, while leave the Subject as blank when the user fill nothing in. To programmatically change the default behavior, we need to override the function before buildEntity take place, is it possible to do that?

Sharepoint List’s Custom Field value appears empty in ssrs report when run in sharepoint integrated mode

I have a sharepoint list that contains custom field(its is developed as .wsp solution), its a file upload control and two rendering templates ‘display’ and ‘edit’ templates are defined. ‘Display’ template displays url of file uploaded using the custom field as ASP Hyperlink.

Template is an .ascx control and its code is as follows:

enter image description here

Then I created .rdl report using report builder to display the Hyperlink field’s url attribute value in one of the columns. SSRS report displays the custom field’s Hyperlink’s url attribute value without a problem.

But problem lies in displaying the hyperlink url attribute value when the same SSRS report is uploaded in share point server Under “Site Assets” Folder inside one of the “Site Collection” that already exists there. Hyperlink Url attribute value is not displayed(all custom field controls related values appears blank). I have used CAML Query(using query designer in ssrs report builder tool) to query the list of Client Details from the sharepoint list(it contains fileupload control details including other text fields)

I am not sure if CAML Query is fully working when the SSRS report built using Report Builder is deployed and run inside sharepoint server. The CAML Query generated to run in SSRS report is copied below:

enter image description here

In above Query ‘All_x0020_Citizenship’ is the reference to file ‘upload field control’ in Sharepoint list mentioned at the beginning. Does this problem has to do with CAML Query?Is the CAML query has to be different to run under sharepoint server through sharepoint report service?

May be i need to change custom control code to be rendered which is complaint with sharepoint report service integrated mode? If so please provide some idea on how program custom control code such that its value can be displayed correctly in ssrs report in sharepoint server.

My Sharepoint List’s AddItem.aspx page view looks as follows:

enter image description here

Please look into the issue and shed some lights on how to find a solution or alternatives to display hyperlink field value in ssrs report in sharepoint integrated mode.

Hope you’d let me know if any part of my post is unclear to you so that i can explain further to clarify any confusion on my post. Any help would be greatly appreciated.

SharePoint List using Choice field with checkboxes/multiple selections – to Excel for Reporting

I work for an organization that allows us to create SharePoint Sites / lists, etc. I have NO backend access to SharePoint, nor do I have access to SQL, SSRS, etc. I do have Access and Excel.

That said, my list in SharePoint is a list of “unique” projects. Each project has a choice field, with an option for multiple check box selections for “product”. So – one to many. One Project may have 1 or MORE Products. I have been asked to generate graphical representation/report – using Excel – of the count of PRODUCTS in our PROJECTS.

When I export data to excel – and attempt to create a pivot table, each project has the PRODUCT lists sorted by a ;#. Which makes it impossible to get an aggregated count by product.

I have multiple fields like this – and hundreds of projects and products – so it’s not conducive to manually break them all out – and I’ll have to run the data on demand or at a minimum monthly.

IS there a way to process this through Excel with limited manual intervention to group / count the individual PRODUCTS?

Get first non null object, non empty string field value from a list

I have a

List<ClassA> listOfClassA; 

ClassA contains another object let say insideObj. I want to fetch the first instance of insideObj which is non null, and contains a non empty field which is a string. Currently i am doing

for (ClassA objA : listOfClassA) {         if(objA.getInsideObj() != null && !objA.getInsideObj().getName().isEmpty())             return objA.getInsideObj().getName();     } 

Is there a cleaner way to do this in Java 8?

Display Template: Retrieving user properties from person field

I’ve been searching high and low for a couple of days for a solution, but can’t find anything that fits. I’ve seen a lot of blogs refer to the Srch.U object and then using various methods. I’ve seen articles that point readers to the default item_person template. I’ve also seen the REST API mentioned, but am more confused than ever.

My current setup:

I’m using SharePoint Online. I have a very simple list called Team Members on a sub site with a few columns:

  • Title (default column – contains a plain text version of the user’s display -name typed in manually)
  • TeamMember (People or Group currently set to Work Email so I can hook up the profile picture from Delve)
  • Job Title (Text field).

I then very simply grab this information and do some stuff to make it all look pretty.

What I would like:

I’d like to be able to use the Person field to pull through a user’s email, phone number and any other properties I might want in the future and display them in the template as required.

My current code:

<mso:ManagedPropertyMapping msdt:dt="string">'Title'{Title}:'Title','TeamMember'{TeamMember}:'TeamMember','JobTitle'{JobTitle}:'JobTitle,JobTitleOWSTEXT'</mso:ManagedPropertyMapping>        <div> <!--#_  var Title = $  getItemValue(ctx, "Title"); var TeamMember = $  getItemValue(ctx, "TeamMember"); var JobTitle = $  getItemValue(ctx, "JobTitle");   _#-->                     <div class="row">                         <div class="col-xs-4">                                 <a href="https://mydomain-my.sharepoint.com/_layouts/15/me.aspx?p=_#= TeamMember =#_"><img class="img-responsive thumbnail" src="https://mydomain.sharepoint.com/_layouts/15/userphoto.aspx?size=L&accountname=_#= TeamMember =#_" alt="_#= JobTitle =#_" /></a>                         </div>                         <div class="col-xs-8">                             <h2 class="media-heading comrole"><a style="color: #CC0000;" href="https://mydomain-my.sharepoint.com/_layouts/15/me.aspx?p=_#= TeamMember =#_">_#= Title =#_</a></h2>                             <h2 class="media-heading comUserName" data-membersip="_#= TeamMember =#_">_#= JobTitle =#_</h2> <p><a href="mailto:_#= TeamMember =#_">_#= TeamMember =#_</a></p>                         </div>                     </div>                 </div> 

Any help as to what option to set my person field to and how to hook into the user’s profile would be very much appreciated.

Thanks a lot,

Tom