Drupal 7 - Is there a possibility to create a revision programmatically without publishing it and maintain original node publish? - drupal-7

I'm working with Drupal 7 and I need to save programmatically a draft node without publishing it but maintain the original node published. I created a new button and when someone clicks on it a function on a custom module try to create a node revision but I have no idea how to do what I wrote up
The user can save as draft the node without lost the originally published node that must be visible to the public view. The save draft must be unpublish and visible only to User owner that can change the node until it will send the request to the administrator to approve the draft node
Someone can tell me how I can do this?
Thanks

Would something like the Save Draft module work? It sounds pretty close to your description.
https://www.drupal.org/project/save_draft

Try Workbench moderation module
It's in core for Drupal 8 (since 8.2).
In Drupal 7 it gives you a simple admin interface, documentation to help you get going and it appears tried-N-true in the community.

Related

Drupal 7 - getting list of pages with number of hits and created date

I'm new to Drupal, I have a site of version 7.12 that I need to make changes to. A complete relaunch. For that I need to provide a list of all the content type pages that are frequently searched and pages that never got hit so that I can remove them. Is there a way to see that list?
You needed to have the statistics module turned on for drupal to track this information. You can see how to turn it on here:
https://drupal.org/documentation/modules/statistics
Another possible solution is if you had google analytics setup on your site you could see all that information.

Unable to call a specific form from a button in codenameone

I have a form designed in GUI designer. I call it "Register" to collect information for new member registration. Some how whenever I try to open this form using showForm("Register",null), I get this error -
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:394)
at com.codename1.ui.util.UIBuilder.getFormState(UIBuilder.java:1711)
at com.codename1.ui.util.UIBuilder.showForm(UIBuilder.java:2195)
at com.codename1.ui.util.UIBuilder.showForm(UIBuilder.java:2263)
I have not been able to find any reason for this. Is Register a reserved name? What other thing can cause this? Please help, I am stuck.
You seem to be using an older version of Codename One, you need to update your client libraries in the preferences.
This can happen if you showed your current form manually (not via the GUI builder), there is a bug in the current version where showForm() tries to get the name of the currently showing form and doesn't check for null. To workaround this just use setName() on the current form or make sure that all your forms are shown via the GUI builder.

How to create different registration form in Drupal7 when anonymous user can't view published pages?

To resolve this problem on my own, I started out by installing Profile2 and Profile2 registration. At no point was I able to generate a page based on the user name (eg, {domain}/private/register). I figured it was not coming up b/c I checked off that anonymous users could not see published pages (which is a site requirement). However, I might have done something wrong but I went over the instructions several time and I don't think I made a mistake. Any suggestions would be helpful.
I think you may have to create a new content type, similar to the normal story or article types, and publish restricted content as the new page type. Apply the access restriction to this content type, and leave the default content types alone.

Drupal 7 - Adding fields in User node or link node to the current user?

I'm designing a website in drupal in which users would be able to set their preferences in different areas. e.g. Fav. Games:.
Now I want these preferences to show in a seperate menu option for the users to fillout. I created a seperate node but I need someone to advise me how to link it with the users. Or if there is any other better way please guide me.
Thanks.
You could use the Profile 2 module: http://drupal.org/project/profile2
You can create profile fields with your different areas, which will be assigned to that user.
In Drupal 7, you can attach fields to any entity that is declared as fieldable; that includes users.
Just add the fields you need from admin/config/people/accounts/fields.

Scary looking warning: Warning: Attempt to assign property of non-object in ctools_block_content_type_render()

I keep getting this warning when I update a view in a panel (I used the Views and Panel modules to create a custom home-page design). We are building an intranet for our company and our IT department has linked our SharePoint network credentials to the Drupal site using LDAP (if this would explain the warning at all). Below is a screenshot, please advise!
The accepted answer is outdated -- see the hilariously-frustrated response by dddave to the users who keep trying to apply a patch that's already been committed.
http://drupal.org/node/1739718#comment-6613292
The updated answer is to download the latest -dev version of CTools, which has the proper patch already rolled into it.
A quick search of the Drupal forum shows that your Drupal version may just need a patch:
http://drupal.org/node/1739718
What version are you running? And did this error only appear after Drupal was linked to use LDAP/Sharepoint credentials? (ie - what was the triggering event? Has this been happening for a while? Did you update Drupal recently? Or are you brand new to this role and so seeing this for the first time?)

Resources