Publish Issue in the Umbraco - umbraco

I am using Umbraco 4.6.2 version of the Umbraco.
Despite of publishing new code from Umbraco Admin Panel, We are not able to view the modified pages. We need to republish the page then only the change is visible on the site. We need to republish on the different environment.
Eg: if i am publishing from my machine i can see that in the menu. but i can't get the same in my colleague machine. When i am login with admin in my colleague machine and publish the code then i can see the Change on the site. then, if i open the site from my mobile i can't see the change.
So, the problem is i need to publish that on every machine. is there any solution of this.
Help me please....

Hi had issue close to this one.
My problem was solved by deleting all items from Recycle-bin. I think if you right click on Recycle Bin and click Empty Recycle Bin, the progress bar wont proceed. If so your umbraco database is dirty. which means in UmbracoNode table there are some nodes that have been deleted but their subnodes are not marked as "trashed" or something like this.
Run following Query against your database to delete all dirty nodes from UmbracoNode table and all their dependencies.
DECLARE #nodeId int
SET #nodeId = 0
SELECT id INTO #nodes FROM umbracoNode WHERE (path like '%-20%' AND id != -20 AND #nodeId = 0) OR (id = #nodeId)
SELECT COUNT(*) FROM #nodes
DELETE FROM umbracoUser2NodeNotify WHERE nodeId IN ( SELECT id FROM #nodes)
DELETE FROM umbracoUser2NodePermission WHERE nodeId IN (SELECT id FROM #nodes)
DELETE FROM umbracoRelation WHERE parentId IN ( SELECT id FROM #nodes)
DELETE FROM umbracoRelation WHERE childId IN ( SELECT id FROM #nodes)
DELETE FROM cmsTagRelationship WHERE nodeId IN ( SELECT id FROM #nodes)
DELETE FROM umbracoDomains WHERE domainRootStructureID IN ( SELECT id FROM #nodes)
DELETE FROM cmsDocument WHERE NodeId IN ( SELECT id FROM #nodes)
DELETE FROM cmsPropertyData WHERE contentNodeId IN ( SELECT id FROM #nodes)
DELETE FROM cmsPreviewXml WHERE nodeId IN ( SELECT id FROM #nodes)
DELETE FROM cmsContentVersion WHERE ContentId IN ( SELECT id FROM #nodes)
DELETE FROM cmsContentXml WHERE nodeID IN ( SELECT id FROM #nodes)
DELETE FROM cmsContent WHERE NodeId IN ( SELECT id FROM #nodes)
DELETE FROM umbracoNode WHERE id IN ( SELECT id FROM #nodes)
DROP TABLE #nodes
then republish all your contents both from "Republish Entire Site" and Right click on sites main node and right click and choose Publish and check both checkboxes.

Related

How do I add a query string parameter to my URL programmatically?

I'll try to explain what I'm trying to do. I have 2 tables in my application. One is Project and the other is Bug. One proyect can have several bugs.
I'm able to add/edit/delete projects. To each project in the database I added an ActionLink so if you click over its name, it should show all the bugs related to that project.
I tell "should show" because I'm able to see the new page with the ID on the URL which is fine, but I haven't been able to assign a specific Project ID to the BUG.
For example:
BUG has description, status, date...and Project ID (which i would like to use to filter my bugs)
So what I would like to do is to get the ID of the project which has been clicked, so when I hit create action, i can store the ProjectID in the BugDatabase with all other values that are stored automatically by MVC.
Are you passing the value with the action link?
#Html.ActionLink(
"BUG",
"PROJECT",
"Project",
new {
ProjectId = myProjectId,
}
)

TFS Query: get only topmost elements assigned to me

I am trying to build a tfs query, which will return only the topmost items that are assigned to me.
Examples:
UserStory (US) is assigned to me and contains tasks that are assigned
to me => query returns only the US
US is assigned to someone else,
but it contains tasks that are assigned to me => query returns the
tasks
US is assigned to me, but tasks are assigned to someone else =>
query returns the US
I struggling to figure out, how to access the parent of a task or maybe this isn't even the right approach. I am working with VS and TFS 2010. Ideas?
[EDIT]
Another idea would be to write a wiql query, that finds all items assigned to me and than checks if the link has some properties, but iam not sure about that. In TFS2013 there supposed to be something similar ("match top-level workitems first"), unless this is just a sorting option.
This is not possible with one query, at least you need 2, because you can't combine link filters with parts of a query:
Flat List
WorkItemType = UserStory AND AssignedTo = #ME
Work Items and Direct Links
WorkItemType = Task AND AssignedTo = #ME
Filters for linked work items:
WorkItemType = UserStory AND AssignedTo <> #ME
Return all top level work items
The first query will just list all User Stories assigned to you, no matter if something is linked or not. The second query will list all Task that are assigned to you, but have no UserStory linked that is assigned to you.
[EDIT]
Another option could be to combine both queries, but I can't test it in my environment:
Work Items and Direct Links
(WorkItemType = Task OR WorkItemType = User Story) AND AssignedTo = #ME
Filters for linked work items:
WorkItemType = UserStory AND AssignedTo <> #ME
Return all top level work items
This will list all User Stories and Tasks that are assigned to you, but have no parent User Story linked.
[EDIT2]
<?xml version="1.0" encoding="utf-8"?><WorkItemQuery Version="1"><TeamFoundationServer>http://tfs:8080/tfs/DefaultCollection</TeamFoundationServer><TeamProject>Test</TeamProject><Wiql>SELECT [System.Id], [System.Links.LinkType], [System.WorkItemType], [System.Title], [System.AssignedTo], [System.State] FROM WorkItemLinks WHERE ([Source].[System.TeamProject] = #project AND ( [Source].[System.WorkItemType] = 'Task' OR [Source].[System.WorkItemType] = 'UserStory' ) AND [Source].[System.AssignedTo] = #me) And ([System.Links.LinkType] <> '') And ([Target].[System.WorkItemType] = 'UserStory' AND [Target].[System.AssignedTo] <> #me) ORDER BY [System.Id] mode(MayContain)</Wiql></WorkItemQuery>

retrieve username for two different ID's in same view

I am trying to get a list of linked users in to a MVC view & I am struggling!!!
Users table has an int ID and a varchar name
User Roles Table has int holderid, int officerid & int role id
Roles table has int id and varchar description
ID in users table is linked to both holder id & officer ID in user roles.
Role id is linked to id in roles
From my controller I am passing in one user ID to a strongly typed user role view. That view displays the name for the user id fine. Each user id will have multiple rows in user roles table, each with a different officer id.
My Issue
My issue lies in the fact that I cannot display the name from the users table that relates to an officer (or at least I can’t work out how to perform this in the view!! Or whether it should be done elsewhere in fact.)
Really what I want to do is say:
#Html.DisplayFor(modelItem => item.users.name.where(item.userid == item.officerid)
But this doesn’t seem to be working. I get this error: 'string' does not contain a definition for 'Where' and the best extension method overload
Can anyone offer any advice??
item.users.name is a string. And you cannot use where on it. Instead try something like this
item.users.Where(item.userid == item.officerid).FirstOrDefault().Name
Now here users is a table, hence a collection.
And are you working without Intellisense ?

Link table on many to many relation is not inserted in NHibernate

I have the following classes:
Hotel: ID, ..., IList<Photo> Photos
Photo: ID, Url
and in the database the corresponding "Hotels" and "Photos" tables and a link table in between that contains the IDs :
HotelPhotos: HotelPhotoID, HotelID (linked to PK HotelID from Hotels table), PhotoID (linked to PK PhotoID from Photos table)
The configuration file for Hotel class is :
...other fields mapped
<bag name="Photos" table="TravelRoutePhotos" inverse="true" cascade="all" lazy="false">
<key column="TravelRouteID" />
<many-to-many class="TravelAssistant.Model.HelperModels.Feedback.Photo" column="PhotoID"/>
</bag>
Whenever I add/update a hotel with a photo, I get correctly the inserted the Photo and Hotel data but the HotelPhotos table remains empty.
I have tried flushing the session after updating, tried setting the "bag" to "idbag" in config file , removing the "inverse" from config file but stil the same result.
Could someone help me out please?
Tamas
EDIT The HotelPhoto class does not exist; only the link table HotelPhotos.
Unclear whether you've edited incorrectly when changing your mapping, but from your code as it is your mapping entry should be
<bag name="Photos" table="HotelPhotos" inverse="true" cascade="all" lazy="false">
You also need to make sure that you're using hotel.Photos.Add(photo); or similar. You've definitely got the right idea about your mapping, and you shouldn't need the reference on Photo.hbm.xml so long as you don't want the Hotels collection in your Photo class.

Adding new data to DB when using 2 tables

I am new to mvc and mvc 3 , I have a db that contain a company table (string id =as the company name )
And a table tourism that contain same info I would like to be able to add data to the tourism table , while selecting a company from the list (that came from the company table)
(The two tables had a dependency vie company_id (and the same name in both))
How can I do it?
Leo_a
create a transaction
insert into the dependent table
inserrt into the main table
commit
I'm not sure I understand the question. You want to select from one table and update the other with the data you selected from the first? Do you have any sample code you can post?

Resources