Drupal StackExchange

PhotoSwipe display only one image from Views grid form

19 hours 54 minutes ago

I created a grid view to display several node images thumbnails (3 columns, and multiple lines), and following PhotoSwipe usage found whithin the README.txt, I specified the CSS class "photoswipe-gallery" to display the field image.

Now when I click on one image from the view, I got the full sized Image as I wanted, but I can't move to the next or previous image that exist within my view grid.

Is there anybody knowing how to do it?

Thanks in advance

Pierre_C

for anonymous user, webform not submitted because of private file

20 hours 55 minutes ago

I have one webform which contain the private file field.

As admin user: i can upload the file and submit the form.

As anonymous user: i can upload the file but while saving the form, i am getting 'file field is required'

Uploaded file '/system/files/webform/abc.jpg' present at '/sites/default/files/private/webform'.

As Anonymous user: i can access file using '/sites/default/files/private/webform/abc.jpg' but get access denied using '/system/files/webform/abc.jpg' url.

Additional Info:

File Setting:

Private Path : 'sites/default/files/private'

Public Path : 'sites/default/files'

Drupal 7.64

Webform : 7.x-4.18

Sunil Pawar

"Select all/Apply all" option in Facet item for checkbox widget

21 hours 15 minutes ago

I am using "Facet-Version: 2.0.7" and "Search API : 8.x-1.34" modules to display the site data using Ajax Filtering in my site. Now I need the functionality "select all/Apply all" option in Facet item for checkbox widget settings similar to "Show reset link". This "select all/Apply all" option is to select all the checkbox in particular Facet item and filter the result uisng Ajax.

Let me know how to do this functionality, is there any module available?. Site Drupal 10.2.5. Thanks in Advance

Facet source option:

tc karthick

Is it possible to set Cookie Session ID from a REST Service?

21 hours 56 minutes ago

I have overridden Drupal's login process by calling a REST API which returns a 'true' or a 'false' depending on whether the login was successful or not. Once successful, I'm logging the user in by using a particular Drupal user account.

Would it be possible to change Drupal's Session ID to the one specified by the REST API call? Currently the REST API Call is giving me a JSESSIONID cookie and I was wondering if its possible to map this cookie to the one Drupal generates when the user logs in. Reason I need this is because I need keep track of this JSESSIONID to call other API methods related to the logged in user.

Joe Micallef

Hook_views_query_alter: adding condition with entity reference value

23 hours 53 minutes ago

I need to filter a table result based the current user.

I added this condition in my hook_views_query_alter

function my_module_views_query_alter(&$view, &$query) { global $user; if ($view->name == 'preventivi' && $view->current_display == 'page_3') { // $view->query->add_where(1, $user->uid, 33, '='); $view->query->add_where(1, "field_data_field_installatori_reference.field_installatori_reference_target_id", $user->uid, '!='); // dpm($view); //dpm($query); } }

but I can't find the correct value of target_id to insert in the condition. Any suggestion?

Ponzio Pilato

One site, two domains

1 day ago

We have a single site that we'd like to have two different domains: apply.school1.edu and apply.school2.edu.

The site is at apply.school1.edu and we'd simply like to create a domain apply.school2.edu to point to apply.school1.edu. That way we can use the domain to determine what content to load on the page.

How can we do this?

Chris Howell

How do I resolve missing content type references from uninstalled modules?

1 day 1 hour ago

In my previous setup of my site, I installed a bunch of modules and had them uninstalled. But now I have many orphaned or missing content types that still resides in the database somewhere. Below is what is displayed on the Field list page where its trying to reference these non-existent content types. Is there a place where I can go to clean this up? Which tables would I be looking into? And if I were to delete these entries where else would I have to delete it?

Patoshi パトシ

Filter Taxonomy reference field on Workbench Access permission

1 day 2 hours ago


i need some help with Workbench access based on taxonomy.

This is my use case:
I have this taxonomy structure for my site:
- Term A
- Term B
- Term C

And i have 2 roles:
- editor
- editor C

Editor c users must be able to create or update only the term C nodes.

I installed Workbench, Workbench Access and Field Property to control this behavior.
I configured Workbench Access on Taxonomy.
In admin/config/workbench/access/roles i put Roles “Editor C” only in “Term C” Section.

I created in each content type a Taxonomy Reference field, based on Workbench Access (i checked “Workbench Access control field”).
So this fields has two purposes:
- tagging the node on my taxonomy structure
- Assign the proper editorial group

The problem:
When an Editor C user adds a content, he can select any term value, not only “Term C”.
In other words the Taxonomy Reference field display all result.

How can i filter/limit the record of taxonomy reference on workbench access permission?

P.S.
If i check “Require a Workbench Access form element” in admin/config/workbench/access/settings the module add a “core” access control field in each content type.
This fields are filtered on Workbench access permission but i loose my first purpose (tagging the node on my taxonomy structure).

Can anyone help me?
Thanks in advance,
Matteo

Matteo

Views Exposed Filter Sort on Entity based on Term Reference Field from Entity Reference Relationship

1 day 3 hours ago

I've been playing around with Views exposed filters on an entity. I have so far been able to create a relationship to another entity through an Entity Reference, and exposed the fields belonging to that entity.

What I needed to sort my entity by was a term reference field on the referenced entity (this is a one to many relationship, the sorted entity can have any number of reference entities). I was able to get a multiselect field to do so, but this is really not ideal. Using Better Exposed Filters I was hoping to get a checkbox list. But it seems that the nature of the relationship doesn't open that possibility up.

So the question is, if I needed a View that allowed sorting an entity by an exposed Term Reference Field filter on all of its Entity References, what method would I use, if not Better Exposed Filters?

jhoffmcd

Feeds with Xpath Parser won't import images using image URL in XML file

1 day 4 hours ago

Importing images into a multi-valued image field using image URLs from an XML file is not working for me. The Xpath Parser debug output shows the multiple image URLs being parsed correctly, but the images don't get imported. No problem with other ordinary fields.

The XML structure is:

<units> <unit> <unit_details> <images> <image> <uri> http://www.example.com/files/content/villa-102-1.jpg </uri> </image> <image> <uri> http://www.example.com/files/content/villa-102-2.jpg </uri> </image> </images> </unit_details> </unit> </units>

The context is: //unit

The Xpath query for the image field is: unit_details/images/image/uri

I played around with the image grabber module for feeds, but it failed also - doesn't seem suited to this task.

  1. Is it possible to import images using the image URL from the XML file?
  2. Is it possible to import multiple images into a multi-valued image field?

I'm using Feeds version 6.x-1.0-beta12+18-dev, and Feeds Xpath Parser version 6.x-1.12

UPDATE:

I was able to import images using the CSV importer and the image URL, so this appears to be a problem with Xpath Parser.

UPDATE 2:

I'm seeing no errors in the dblog or the server log. That patch is for D7. The images do not show up in the node display, but the other fields do.

Looks like the "enclosure" error gets thrown if the local file name isn't in the right form, but I just have an external URL. As I mentioned above, the image with the same URL does get imported using the CSV parser, so it doesn't appear to be a problem with the Feeds module, just the Xpath Parser.

The relevant code in D6 (FeedsParser.inc) is:

/** * @return * A path pointing to a file containing the resource referenced by the * enclosure. This method downloads the resource if it is not local. The * file path must be considered temporary and is only valid for the current * page load. * * @todo Get file extension from mime_type. * @todo This is not concurrency safe. */ public function getFile() { if (empty($this->file) && $this->getValue()) { // Check if this enclosure contains a local file. if (!parse_url($this->getValue(), PHP_URL_SCHEME)) { if (file_check_location($this->getValue(), file_directory_path()) || file_check_location($this->getValue(), file_directory_temp())) { if (file_exists($this->getValue())) { $this->file = $this->getValue(); return $this->file; } } throw new Exception(t('Invalid enclosure %enclosure', array('%enclosure' => $this->getValue()))); } $filename = basename($this->getValue()); if (module_exists('transliteration')) { require_once drupal_get_path('module', 'transliteration') . '/transliteration.inc'; $filename = transliteration_clean_filename($filename); } $dest = file_destination(file_directory_temp() .'/'. $filename, FILE_EXISTS_RENAME); if (ini_get('allow_url_fopen')) { $this->file = copy($this->getValue(), $dest) ? $dest : 0; } else { $this->file = file_save_data($this->getContent(), $dest); } if ($this->file === 0) { throw new Exception(t('Cannot write content to %dest', array('%dest' => $dest))); } $this->delete_file = TRUE; } return $this->file; } }
Jeff