Issue with Finder in Drupal 7 - drupal

So, I am using Drupal 7 and I'm having an issue with the Finder module.
I have a view set up with a list of a specific content type. In my Finder I have 2 select lists set up to filter the view, both with a blank option appended to the beginning, and also a text box.
When I view the page and select a value from either of the select lists the page works fine. The problem pops up when I leave both select lists blank and the text field empty. Instead of returning all results, which is the behavior I want, it return no results.
In the Finder module for my select lists I have 1 of the "Choices" set to Used Values and I have the field set to the correct content type I want to filter on. The 2nd Select List is set to "Available Options." Both Select Lists have the "Empty Choice" setting set to "empty."
If there is any other information I can provide, let me know.
This has been a very difficult bug to Google and I am hoping someone can point me in the right direction.

Answered.....Sort of.
The problem turns out to be version of WebForm module that is being used. We were using version 7.x-4.3, which is the latest, but rolled back to version 7.x-4.1 and the issue resolved itself.
It seems odd to me that a product that is used by hundreds of thousands of people would let a bug this annoying slip by.

Related

Get Requsition ID based on PO

In FSCM I am looking to modify the Search view on Add/Update PO page (Main Menu--> Purchasing--> Purchase Orders--> Add/Update POs) to display the Requisition ID associated with the PO in the search results page. The only table I have found that has both PO_ID and REQ_ID is PS_PO_LINE_DISTRIB however unless I use a SELECT DISTINCT clause I will get multiple PO_ID rows when there are more than 1 line on a PO.
Within Purchase Order Inquiry you can see the related Requisition ID's related to a PO by clicking on Document Status link inside the Purchase Order inquiry details page.
I started looking at the PeopleCode within the the Purchase Order Inquiry to see how they are linking the PO to a Requisition and it appears to use work tables with related PeopleCode function libraries, but I wasn't able to figure our how they get linked. I am hoping someone else may know the answer to this. Thank you.
I'm on an old version of PeopleSoft (SCM 8.80, Tools 8.51), so your mileage may vary. I'm assuming you're familiar with App Designer. If not, comment below and I'll add some details about what I'm clicking on.
Find the name of the Add/Update PO component.
Open the PURCHASE_ORDER component in App Designer. Now let's find the name of the search record. Note that there is a different record for the Add Search Record, so if you want to change that too, do all of this for that record as well.
Open the PO_SRCH record, and add the REQ_ID field to it. Make sure you mark the field as a key. You should consider saving your modified PO_SRCH under a new name in case you want to be able to revert to vanilla PeopleSoft. If you do, change the Search Record in the component to your new record name.
We can see that PO_SRCH is a view. So let's modify the view to pull in REQ_ID from PO_LINE_DISTRIB. As you mentioned above, there doesn't appear to be another table with both PO_ID and REQ_ID, so you'll have to do a SELECT DISTINCT.
We should do a LEFT OUTER JOIN instead of a standard join because if you do a standard join and you enter a purchase order with no lines and save it, then you'll never be able to retrieve that purchase order in this window. Since REQ_ID is a key field, we can't have a null, so we have to do the CASE.
One odd thing that I ran into here was building the view now gave me an error about selecting fewer columns in the SQL than I had in my record definition. I solved it by modifying the view for SQL Server. I've never had to do that before and I don't know why I had to do it for this specific record. But anyway, I entered the same SQL under the record's "Microsoft SQL Server" definition.
In the properties of PO_SRCH, we can see that it has a related language record. If you're only using one language, you can probably get away without changing this, but I'll do it for completeness. Open PO_SRCHLN. Now add REQ_ID to it (mark it as a key field like you did above), and save it as PO_SRCHLN2 (I'm saving it under a new name so I don't break anything else that may be using PO_SRCHLN).
Edit the SQL the same was as you did above. Note: I didn't have to also change the Microsoft SQL Server definition like I did above. I have no idea why.
Now build PO_SRCHLN2.
Go back to PO_SRCH and change its related language record to PO_SRCHLN2.
Now build PO_SRCH.
Hopefully you didn't get any errors and your search page has the requisition ID in it now. My system doesn't use requisitions so they're all blank in the example below, but the new field is there.

Table input for view

I would like to have the user enter order items on my order form as a table where they input the Qty and Prod #. I've not programmed with that type of field so a blank line would initially display for a new order. They would type a Qty and an item number in the fields and hit enter. When they hit enter from either field, what do I program to check the validity of the two fields. Plus I need the item number to be a drop down/type ahead field. Does anyone have an example of this type of thing they could send me? It would be looking at a view in the product catalog db. Also, after they enter an item to order, that "doc" should get stored/saved and a new blank line should open up.
What type of control do I need to use and should these items be stored in their own form or on the main order document? Could use some guidance here. Thanks.
The question you have is a little broad but I will make a couple suggestions if I can.
You have the main order doc. Then a repeat control with each item. Filter each item by a uniqueID that allows you to join the main doc to the child docs. Each item should be a separate document. You then need to make the items in the repeat control editable.
There is a lot of things going on here and I think you need to get started somewhere. I think the first step is to do a repeat control with response documents.Xpages, Inherited documents in view panel by using #Unique

Drupal: Content type in database not in the list of content types in Structure>Content types

A while ago I created two content types: 'protocol' and 'protocol2'
They were a little different and I wasn't yet sure of which one suited my purposes best, so I tried out both and created some content of each. After a bit of testing I concluded that 'protocol2' was the one I was gonna use and that I wanted it to be called 'protocol' and not 'protocol2'. But I wanted to save the other version of the protocol content type so I taught I would simply swich their names.
So I tried swiching their names, but during this process something went wrong with the 'protocol2' content type that I wanted to use and it just disappeared. Or so I taught. Anyway I renamed 'protocol' to 'protocol1'(Name and Machine name). And recreated the one that disappeared. I gave it the name Protocol and tried to give it the machine name 'protocol' but this didn't work so I ended up having to name it protocol2 again.
I have now discovered that there is in the node_type table in the database actually a content type with the machine name 'protocol' which doesn't show up when I look in Structure>Content types on the page. Can I simply clear it from that table or is there some other more propper way to do it?
I have been using Organic groups, and had content type of type 'protocol' or 'protocol2' associated with some groups(I don't remember which). And I think it's screwing up one of the views on the group page. The list with the heading "Publish content to group" consist of "Post" and an empty list element. Where can I control this list? Isn't this supposed to be a view?
In the node_type table, make sure locked is 0 and disabled is 0 for all your "protocol" types. Change all their orig_type values to match their current type values. Clear the Drupal cache in admin/config/development/performance.
They should all now appear in your "Content types" list and you can work from there.
This is an active bug for Drupal 8, with the possibility of any patch being backported, under Drupal issue 515454.

Drupal 6 & Views 2 - DISTINCT field

I'm using the Feeds module to import lots of Feed Item nodes. Due to a malformed feed file, I'm getting lots of duplicates. I'm using a View to display these nodes, and need to be able to add a DISTINCT filter on the "Node: Post Date" field, so I only get 1 result for each post-date.
I will also look into tackling the problem at the source so to speak (I don't want to have all those duplicates in the first place), but this is an interesting issue in itself - I can't find a way to add a DISTINCT filter on a field other than the Node ID (which has it's own option in the View's Basic Settings box).
I found a great article on a good way to alter the SQL queries that are generated from views before they get executed: http://echodittolabs.org/blog/2010/06/group-views. I used this to basically suffix a GROUP BY clause to the end of the query (in a really nice, clean and versatile way).
As an aside, I also found a way to tackle the issue of importing lots of duplicate feed items, the details of which are here: http://drupal.org/node/661314#comment-3667228. It adopts quite an extreme approach (deleting all items before each update), but this is the only solution for some nasty malformed feeds.
I was holding out for some undiscovered feature of Views that let you do this, but I don't think there is one - maybe in the next version ;)
There are two option to solve this:\
apply this patch
OR
hook_views_query_alter => just paste
$query->distinct = 1;
$query->no_distinct = 'views_groupby';
I guess you have two options: either put some logic in the view template file to skip the duplicate items or implement hook_views_query_alter() to change the query used by the view, adding the DISTINCT clause.
We found this issue in drupal 6.x view - had 7 of 150 items duplicated one or twice. No idea why. Issue only appeared for anonymous users. Luckily, views 6.x.2.16 provides a 'distinct' setting under the basic settings, I set it to Yes and got rid of the duplicates.

Combine two views into one view

I have two views that I would like to combine into one.
The first view shows all items of X where company ID = Y. This is to give preferential sort to the client first, and then everyone else.
So I created a second view, all items of X, where company ID != Y.
I created it as an Attachment to attach to the first view, but I don't think I got the intended result.
How can I combine these views so the first view results are listed first, and then the second view is too, using the same pager, filters, and arguments?
Is there any way of achieving this without programming it?
From a MySQL point of view, the order-by-field syntax would be the appropriate way to handle this. Example:
SELECT * FROM tickets ORDER BY FIELD(priority, 'High', 'Normal', 'Low');
It would be great if there is a module that add this kind of functionality to Views, but AFAIK, it does not exist.
If you want to solve this without programming, I think you can use the rules module to automatically set the 'sticky' checkbox on nodes where company ID = Y. With that in place, you can order the View on the sticky value.
Along the lines of the 'sticky' idea, if you didn't want to override that, maybe you could add a checkbox field to the company type -- isClient. Make it false for everyone except the client, and sort by that.
I haven't done this, but maybe you need to create both versions as attachments, and attach them both to another display...?
for drupal 5 there was views union. Someone started something for D6, but I don't know how far they got.
http://drupal.org/node/275162
Create the second view as an attachment and attach it to first.
Set all Inherit arguments, Inherit exposed filters and Inherit pager to Yes.
how is the client parameter passed to the view? as an url argument? if so, you can create your second view like i outline here and then select the exclude the argument option on the appropriate location.
usually the easiest way to achieve this is with a small hook_query_alter, but that requires a small amount of programming.
A little bit later... but I've found a better solution using only the Views module:
Create a Block View with that shows the first list that you need ("all items of X where company ID = Y")
Create another View that must be a "Page view" with the second list (all items of X, where company ID != Y)
In the "HEADER" settings of this second view, click "Add" and select "Global: View area".
In the "View to insert" list, select the first you have created (and check "Inherid contextual filters" if you are using it)
And that's it!

Resources