Drupal-6 multiple profiles selections after installation? - drupal

I have created multiple profiles in my Drupal site. Currently Drupal allows us to select any 1 profile during installation.
But I need to change it a bit, what I want is that the admin can choose any profile after the drupal installation finished.
Is there any way to get around with this problem. I have googled for almost an hour now, but no luck.
Thanks in advance.

I assume you're talking about installation profiles? The answer is a resounding no I'm afraid, they are installation profiles, they don't do anything after the installation has taken place so allowing an admin to 'choose' a profile on a fully installed site would have absolutely zero effect.
If you really want to do it though (as an exercise into getting to know Drupal or something) then run this PHP code:
variable_set('install_profile', 'name_of_profile');
As I say though, I can see zero value to calling that as it will make no difference whatsoever to your site once it's been installed.

Related

How to version control with WordPress

I want to set up a system where a developer can work on a separate server on a wordpress website.
My question is: If in the meantime changes are made to the live site (like plugin updates, new plugins, new posts, new comments, etc), how is one able to import a new feature (e.g. a new page) from the development server on the live site while making sure that previous changes on the live site don't get deleted?
I am looking to understand how this all works. In a sense, I would like to have some kind of version control system.
Thanks in advance :)
You can version control your own code using git. Basically we would init a new git repo and commit changes onto this repository. This can lie separately outside of the core files. i.e you only need to include the wp-content directory and ignore all the other core wordpress files.
Here is a good article on how to do a really good versioning system for a website.
http://toroid.org/git-website-howto
The posts and pages (basically content) in a wordpress site however lies in the database.Any changes made there will be permanent.
The only option is to keep taking regular backups of the content. You can do this by using an automated backup tool.
If you really want to version control your database, here is an article that helps:
https://blog.codinghorror.com/get-your-database-under-version-control/
This one is a tricky one. You cant host a single website on two servers. Just imagine a website having 2 hosted urls..!! No way.. You can never do that.
You better create a new user and give access to him. Look carefully in the settings and be a admin. You will have a chance to approve or reject what the second user changes.
Hope this helps.

Microsoft Azure wordpress install is not appearing

I have set up a second wordpress web app in Microsoft Azure however when i go to the url no wordpress install wizard is appearing. Not sure if this is because i am on a free account that can be used by students or if i have done something wrong? My first web app is still working. Thanks for any help.
It shouldn't have to do with anything about being a student. There is a free tier, and you can make multiple free tiered sites.
You didn't say what appears when you go to the URL though, so it could be any number of errors. Here is a checklist of what I'd go through:
Make sure you are going to the correct new URL
Can you FTP into the new web app, and verify there is WordPress code there? If not, something weird happened in the set up process! Delete the web app and try again, or simply upload WordPress yourself! Can get the files from WordPress.org and upload yourself using FTP
If WordPress code is there... What appears when you go to the URL? If it's an error message, something might have messed up in the install. You can always delete it and remake it to start again. Without knowing the error message, I can't really give more specific advice.
As a side note, did you create a new ClearDB MySQL database? Can you confirm there is a second database on your ClearDB account? If not, that could easily be the problem.
Sorry to give vague answers, but without more specifics to go on not many more details I can give. Except confirm that yes, you should be able to make multiple WordPress sites, so either something has gone wrong or you did something wrong.

Can Wordpress automatic update harm my website?

Recently I got to know that my Wordpress site is automatically updating itself when a new version of Wordpress is available. I know that this automatic feature is available in
Wordpress since sometimes back. But I have some questions about this
1) Can this be risky in any case?
2) Doesn't it a matter the way how we have installed Wordpress? (e.g plugins and security settings)
3) Does Wordpress have a way to recover our website if anything happen?
4) Don't they keep any backup before do the update?
Could you please give me your answers to the above?
I'll answer each of your questions to the best of my knowledge:
1) Can this be risky in any case?
The automatic updates are mostly security updates. Though you can never be 100% sure it doesn't break anything, security updates don't deprecate functions or change much on how the CMS works. This means that nearly every plugin and theme can still use the same functions without issue.
2) Doesn't it a matter the way how we have installed Wordpress? (e.g plugins and security settings)
This ofcourse matters, to some extend. But if a site is working in Wordpress 3.8.3, it will still work in Wordpress 3.8.4. If a site however uses functions that will be deprecated, you might have problems when upgrading from 3.8 to 3.9. However, major updates aren't done automatically, and still need to be done manually, giving you the opportunity to make a backup beforehand.
3) Does Wordpress have a way to recover our website if anything happen?
No, it doesn't. You CAN however turn of the automatic updates. But, as stated at question 1, the risks aren't very big with the security updates.
4) Don't they keep any backup before do the update?
No they don't. It is your own responsibility to keep backups of your website.
I hope this answers your questions. If something is unclear, please let me know in the comments, and I'll look into it for you.
If your themes and plugins use functions from Codex then I think your are much safer. Make sure the plugins and themes are using functions to get directories and URI's through functions defined by Codex, what I mean to say is:
use: get_template_directory_uri();
instead of xyz.com/wp-content/themes or even home_url('/wp-content/themes'); and other things like that.
yes sometime it can create a mess and it won't allow to admin to login.
most command questions asked are
Can't login after automatic update
login failed after wordpress update.
here is a very quick fix for all of them.
http://onl9class.com/solved-cant-login-after-wordpress-update/
Here is all answer of your questions, please check below:
1. Can this be risky in any case?
The automatic updates are good for security purpose but some times it will break our function work in website because some plugin developer will not update own code according to wp updates so it would be good you can manually updates all things after checking plug-ins compatibility with new version.
2. Doesn't it a matter the way how we have installed Wordpress?
No it always matter, because some times wordpress core developer changes the function and they will be depreciate in new version so it would be good, always take backup of website and manually do the updates.
3. Does Wordpress have a way to recover our website if anything happen?
No, but you can install wp plugin and schedule it to take backup in each week.so you can at-least get the latest backup of website. I always use the back up plugin in my websites.
4. Don't they keep any backup before do the update?
No they don't take backup of website. but wp always show notification when you start update please take backup.
Thanks

Drupal 7 user registration: creating mandatory gender/city fields

I'm a Drupal newbie, but have successfully installed it at a CentOS 5.5 Linux, PostgreSQL 8.4.7, PHP 5.3 machine.
I've chosen minimal installation and then enabled following modules: Block, Image, Locale, OpenID (hope to add Google accounts later...) and Search. The User module etc. are enabled by default anyway.
My problem is:
I don't know how to add Gender/City fields and make them mandatory.
As a SPAM-fighting measure at my old phpBB 3 site I have a mandatory question for new users about their gender: Robot/Male/Female and the first answer is default and prevents the new user from registering.
Is it possible to do the same in Drupal 7?
And I hope it is doable without installing any additional modules as the stock install is easier to update. (That is what I was doing with my old phpBB site - with no mods installed).
Thank you for your answers! Alex
UPDATE:
Here is my Field module screenshot, does it look ok?
Maybe my problem is that List is shown as disabled?
First, note that there is a huge difference between Drupal modules and phpBB mods. Drupal provides API's which allows modules to integrate with Drupal without changing any code. You can just download them into a folder, enable and they are running.
And yes, what you are trying to do is possible without any additional modules. Just go to admin/config/people/accounts/fields, add a Gender field of Type "List (text)" (If that is not available, you might need to enable it, but it part of Drupal core), then, enter the allowed values and on the second page, check the "required" and "shown on registration form" checkboxes and you are good to go.

Drupal: xmlsitemap file is not generated

I have chosen XMLSiteMap module from the most popular usage statistics on Drupal site,
so I assume the module is not too buggy. But the map file is absent.
I've installed this module on my Windows machine into drupal/sites/default/modules.
I've activated all the submodules of XMLSiteMap in admin menu.
Per docs, I've also run cron.php manually to create sitemap.xml in drupal/sites/default/files - but it's just not present there even when second re-install.
How can I force to create sitemap.xml?
(also tried with and w/o clean URLs - still no help).
Also, if there any good reliable alternative for this module?
Are you sure you've installed it properly? Please check the Status report (admin/logs/status in Drupal 5, admin/reports/status in Drupal 6) to ensure that you've got everything right.
It's possible that you haven't set the permissions of sites/default/files properly yet for example.
I'm not sure if this will help you, but if you are looking for an actual created sitemap.xml file rather than navigating to it in the browser I don't believe one is created by the module. I think the module creates a menu callback to create the sitemap file, so a request for sitemap.xml is handled by Drupal's menu system, rather than creating an actual file. There will however be a cached version in sites/default/files/xmlsitemap.
Apologies if this is an oversimplification of the question asked.
I have not had any problems with the reliability of the module myself.
Also make sure you have the latest version installed, it just came out yesterday:
http://drupal.org/project/xmlsitemap
Also, see this issue, seems related to your problem:
http://drupal.org/node/458546
I'd probably recommend trying the 6.x-2.x branch which I've been rewriting to kind of solve all the annoying bugs and architectural problems of the 6.x-1.x branch. It's currently incomplete, but it works for nodes and menu items currently. Taxonomy terms and user profiles will be added soon.
You can find the link to it on the project page. Sorry I can't link since I'm a new user. :)
Running the CRON worked for me:
/admin/reports/status/run-cron

Resources