Closed (fixed)
Project:
Subsites
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
17 May 2010 at 09:13 UTC
Updated:
23 Dec 2016 at 07:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
James Andres commentedHi, I needed subsites module on a recent d7 project so I upgraded it. Find it here https://github.com/jamesandres/subsites.
Davy Van Den Bremt could you take a look and perhaps make a 7.x branch on Drupal.org based on the GitHub work? :-)
Comment #2
webankit commented+1
Comment #3
WadeTheFade commentedYes Please! My clients are in need of this too.
Comment #4
chaosmind commentedOoh! Ooh! +1!!
Comment #5
rolandk commented+1
Comment #6
clashar commented+1
Comment #7
James Andres commentedThe 7.x-1.x has just been committed, a beta release to come shortly. Stay tuned :-)
Comment #8
dannymontalvo commented+1
Comment #9
clashar commentedI see no 7.x-1.x releases
Comment #10
philipz commented+1
James was talking about GitHub release.
I was just thinking about going back Drupal 6 before I found this thread :) How's the beta release going ?
Comment #11
James Andres commentedQuick update, I've requested Davy make a 7.x-1.x release but am still waiting to hear back from him. I have commit access but can't create releases. I'll update here when I know more, sorry guys :-/. For now go ahead and use the 7.x-1.x branch from Git.
Also, there is a ticket open to upgrade the subsites_access project. I don't have the time to look into that one, anyone else care to give it a shot? I think the code in Git is nearly there (Coder Upgrade did a good job overall), just needs the final tweaks.
Comment #12
davyvdb commentedI've created a dev release. Once, that has been tested and subsites_access is ported, we can move to an alpha/beta release.
Comment #13
rolandk commentedgreat news!
Comment #15
awm commentedsub
Comment #16
hbblogger commentedHi James and Davy,
I am very interested in using your module. I have not used drupal 6, so I keep seeing these brilliant modules only available in DR7. I tried downloading James' version from his Git site, but there seem to be quite a few problems still (eg - I get an error when I try to attach a node and a I get a lot of errors if I try to activate the 'subsite access control' and then re-build permissions.) So, unfortunately I haven't been able to put any sort of site together.
Davy, you mentioned that you have a beta version, but there doesn't seem to be any mention of this anywhere on the Drupal site?
I would be happy to assist where I can with either testing or documentation. Unfortunately I'm not a proficient programmer!
Rgds Paul
Comment #17
James Andres commentedHi houtbayblogger,
There is currently a Drupal 7.x dev version of subsites available from the project page (http://drupal.org/projects/subsites). Scroll all the way to the bottom and click on "View all releases". There is currently no officially sanctioned D7 release yet, that's why it isn't available on the main project page.
The version on github is completely obsolete, I'll remove it.
Thanks,
James
Comment #18
hbblogger commentedHi James, Thanks very much for responding. I have downloaded and installed the version that you mentioned (7.x-1.x-dev).
The link in your site referring to documentation is broken, so I had to soldier on alone!
Initially I tried it on the site that I was working on (which has a number of other modules already installed) and I couldn't get past 'Rebuilding content access permissions' (got a page of Ajax 500 errors - mostly referring to place holders. I tried disabling some of the modules but no luck, so I did a clean install of Drupal (actually drupal 7.9) and the installation went fine.
I set up a sub-site using the structure/subsite menu. I then tried to set up a page (just used basic page as a node). I got access control errors, and realized I needed to set up permissions. Still got errors, so I disabled the subsites access control module - no further errors. Set up two test pages, both linked to subsites. Went to structure/subsites and tried to set up a menu. Got an error:
The requested page "/dr7.9/admin/structure/menu/manage/subsite-2-marlinspike?render=overlay" could not be found.
Not too sure what to do now. Is there something else that I should have set?
Possibly my approach is wrong? Are there any tutorials out there to help set up a basic sub-site and to link this to my main site?
I'd be happy to send you any errors that I encountered if it would help you in your development.
Cheers
Paul
Comment #19
hbblogger commentedHi James, Thanks very much for responding. I have downloaded and installed the version that you mentioned (7.x-1.x-dev).
The link in your site referring to documentation is broken, so I had to soldier on alone!
Initially I tried it on the site that I was working on (which has a number of other modules already installed) and I couldn't get past 'Rebuilding content access permissions' (got a page of Ajax 500 errors - mostly referring to place holders. I tried disabling some of the modules but no luck, so I did a clean install of Drupal (actually drupal 7.9) and the installation went fine.
I set up a sub-site using the structure/subsite menu. I then tried to set up a page (just used basic page as a node). I got access control errors, and realized I needed to set up permissions. Still got errors, so I disabled the subsites access control module - no further errors. Set up two test pages, both linked to subsites. Went to structure/subsites and tried to set up a menu. Got an error:
The requested page "/dr7.9/admin/structure/menu/manage/subsite-2-marlinspike?render=overlay" could not be found.
Not too sure what to do now. Is there something else that I should have set?
Possibly my approach is wrong? Are there any tutorials out there to help set up a basic sub-site and to link this to my main site?
I'd be happy to send you any errors that I encountered if it would help you in your development.
Cheers
Paul
Comment #20
James Andres commentedHi houtbayblogger, it sounds like you are attempting to use the subsites_access module. This part of subsites hasn't been upgraded for D7 yet (so that module won't work). You can follow progress of that issue here: #1248022: SAC: D7 Upgrade. Of course, if you're interested in helping to upgrade subsites_access that would be awesome too!
Subsites module installed without subsites_access should be a fairly smooth install (and it should be working). If you tried installing subsites_access first, then uninstalled it, it's hard to say what sort of changes (or breakage) may have occurred to your database. It's best to restore from a backup and only install subsites (without subsites_access).
Comment #21
hbblogger commentedHi Andres, I'd love to help out but unfortunately I have not graduated to writing code. I've set up a clean installation and will re-try subsites with the subsites_access module removed.
Comment #22
hbblogger commentedOK, I have it up and running (again!) with similar bugs.
1. Try to open a new block and get the following error:
Notice: Undefined variable: form_id in subsites_form_block_add_block_form_alter() (line 47 of C:\wamp\www\dr2-7.9\sites\all\modules\subsites\subsites.blockvis.inc).
Notice: Undefined index: page_vis_settings in subsites_form_alter_block_visibility() (line 61 of C:\wamp\www\dr2-7.9\sites\all\modules\subsites\subsites.blockvis.inc).
Notice: Undefined offset: 1 in subsites_parse_block_visibility() (line 37 of C:\wamp\www\dr2-7.9\sites\all\modules\subsites\subsites.blockvis.inc).
2. Try to connect to an existing node/page
Deprecated function: Function eregi() is deprecated in subsites_content_nodes_form_submit() (line 252 of C:\wamp\www\dr2-7.9\sites\all\modules\subsites\subsites.admin.inc).
Node not added. Not a valid node.
but when I go to the node and choose the site to attach to, it gets added.
The errors are the same as for the previous installation where I had only disabled (not removed) the subsite_access module.
Neither of these seem to be show stoppers. If I come across any others, I'll let you know.
Comment #23
tmedlen commentedhoutbayblogger, this is what I did to suppress the errors, not having the eregi() issue though; edited subsites.blockvis.inc
line 36 changed
if (count($matches > 1))toif (count($matches) > 1)then in function subsites_form_alter_block_visibility changed the $pages variable
$pages = $form['page_vis_settings']['pages']['#default_value'];changed to
$pages = $form['visibility']['path']['pages']['#default_value'];for the form_id error I added
$form_id = $form['form_id']['#value'];inside functions subsites_form_block_add_block_form_alter & subsites_form_block_admin_configure_alter- hope this helps
Comment #24
hbblogger commentedMany Thanks tmedlen, That has solved problem 1 and the second one is easy to work around. Rgds Paul
Comment #25
strykaizerAttached you'll find a patch containing tmedlen's code, fixxing issue 1 in post #22
Comment #26
rta commented//404 not found for this link
:(
Comment #27
James Andres commented@rta, the official Subsites d7 branch is on drupal.org. It is not on github any longer.
Comment #28
yareckon commentedI've patched the problems with the node add process (repairing the autocomplete callback to return nid, and replacing the deprecated eregi function with preg_match).
Attached are two patches, one that contains only my changes without the patch from 25, and one that for convenience contains the block system changes from #25 in addition.
Comment #29
yareckon commentedSorry, this file is the one without
Comment #30
yareckon commentedHere is an addtional patch that fixes the link from the subsite screen to the subsite menu edit page.
I've also rolled a cumulative patch containing all of the patches in the thread.
Comment #31
yareckon commentedThere is also Alan. D. 's code over in the other thread #1359942: D7 port , that makes subsites into entities. I am interested in fusing the two approaches.
The existing subsites module has the ability to use path based selection and better block handling, but in the other module, subsites as entities are fieldable, which one can use to store a lot of extendable data about the subsite with no extra work (logo fields, About page, colorpicker, views integrations references etc..)
I would be interested in making the core subsite into an entitiy that could be fieldable, but keeping the idea of a subsite as a container that could be active on paths and other nodes rather than just on items that are in a particular menu like in Alan D.'s module.
James Andres, are you interested in this approach at all? I've contacted Alan D about whether he could work on it.
Comment #32
francescoq commentedHi, i'm using subsite for D7 in a work, when i try to show the subsite name between the fields in a view i've got this error
i can't understand what happens.. at the moment i'm using taxonomy (with same name of my 2 subsites) on the desired content type to bypass the problem, but it's not a quite a good way to do it :P
from a quick search i can see that maybe db_placeholders() is a D6 only function... but i don't understand very well all those things, i'm sorry!
Thank you!
Comment #33
alan d. commentedSadly no time to push any energy into this, but having fields is very useful. Definitely recommend adding these :)
The function db_placeholders() is gone, replace with updated db classes and do something like this instead:
db_select('target_table', 't')->condition('t.target_field', array('a','b','c',...));
db_select('target_table', 't')->condition('t.target_field', array('a','b','c',...), 'NOT IN');
Comment #34
francescoq commentedHi, i tried to replace the db_placeholder() function.
I'm a beginner in these thing so i don't know if everything is fine.. (and i don't know yet how submit a patch even if everything is ok :) )
So..
i replaced the old lines
with these
the result of the query is
SELECT s.sid AS sid, s.name AS name, n.nid AS nid FROM {subsites} s INNER JOIN {subsites_node} n ON s.sid = n.sid WHERE (n.nid IN (:db_condition_placeholder_0, :db_condition_placeholder_1))everything seems ok to me, it works in my case.
Hope it can be useful to someone!
Comment #35
francescoq commentedI've created the patch, it's my first one.. so i hope everything is ok!
EDit: ok.. it doesn't seems to work the attachment.. i try to find out why.. sorry
Comment #36
francescoq commentedHere's the patch to show the subsite field in views :)
Comment #37
francescoq commentedI took a look at Subsite Access Control, and submitted a patch that worked for what i can see (i'm not using it, so maybe i haven't tested in all conditions).
http://drupal.org/node/1248022
Comment #38
francescoq commentedI found that if the view have no result a notice is given, this should fix the problem
Comment #39
m4oliveiHello!
First off, great idea for a module. We've been implementing variations on the same thing for a couple different projects. I had in mind to redo our internal "subsites" module, when I found this module, which incorporates a lot of the same ideas I had and more. So instead, I've patched the D7 version of this module big time. The patch is attached. I've incorporated all patches in this thread, plus a few more bug fixes and feature adds:
Still a few things I'd like to do:
Please try it out and let me know! The patch is against the latest in the 7.x-1.x branch.
Thanks,
Matt
Comment #40
m4oliveiNew inclusive patch that includes a bug fix to the views integration, as well as a couple extra handler definitions. Also includes JS that updates the vertical tab summary on the node edit form (which may have got lost). Finally, includes the ability to override the logo per subsite from the Look and Feel tab.
Let me know what you think.
Comment #41
francescoq commentedHi! Great work!! i'm going to try it out in this weekend i think, i need this module for an extra-work site, so i haven't much time to work on it, thanks so much!
Comment #42
francescoq commentedHi, I tried to apply the patch on my site, but after running updates it gives me a lot of notice: 321 of these:
And when i view any page of the site this is the error.
Maybe I can't use the patch in a project with subsite already installed?
Now i dig in it to understand something!
Comment #43
francescoq commentedHi, i'm trying to use it in another project. Starting from zero and applying #40 works for me... But I've a problem in context plugin: if i select a condition where i want a subsite there's no problem, but if i check -Main site- option at execution time (function execute($subsite) ) $subsite is an object, not an array.. so it doesent' work.
At the moment i added
only to use it.. but i can't understand why sometimes $subsite is an array and sometime an object
Comment #44
francescoq commentedok... sorry i haven't seen before... here's the catch
why?! i can't see a valid reason to make this difference... i see it as a risk
Comment #45
sivapattabhiram commentedHi! I integrated the patch by m4olivei (#40) and could get the basic functionality working without any problems. Some of the issues I faced are:
a) The template files are not recognized by the subsite. I have modified the function subsites_preprocess_page() to use D7 'theme_hook_suggestions' variable. Have also renamed the template suggestions to page__subsites__ which is in line with the D7 convention (the existing page-subsites- suggestion was not working).
As a consequence, the template files need to be named as page--subsites--{subsite-id} or
page--subsites--{subsite-slug-name}.tpl.php
b) The menu blocks were not working. I have modified the subsites_get() function to query the menu name from db and subsites_block_view() function to use drupal_render() to render the menu tree.
Please find attached the patch with these fixes. You have to apply patch #40 on 7.x-1.x branch before this.
Comment #47
gislePatch in #40 has now been applied to the repo and pushed to 7.x-1.x-dev.
I'm, still reviewing comments #42-45 and the patch in #45. Any help with reviewing will be much appreciated.
Comment #48
chunty commentedFor anyone having problems rebuilding permissions due subsites access control. I found that the problem seemed to be down to
subsites_access_control_node_access_recordsusing boolean values in the array.If you change all these to use respective integers then it seems to work ok:
I end up with the following function:
Comment #49
gisleUnassigning.
Comment #50
andrey.troeglazov commentedHello,
I`m working on it, any help will be appreciated. Thanks!
Comment #51
andrey.troeglazov commentedComment #53
andrey.troeglazov commentedApplied patch from #45 and used changes from #48 with some changes.
Thanks to all, commited to dev branch.
Checked general functionality, for me its ok, but there is some notices.
Closing the issue, if someone wants to fix any other issues please open new ticket.