Removing a custom JavaScript reference from a Drupal 7 subtheme is a task that can be accomplished

After following the instructions for handling javascript in Drupal 7, I placed a "myjs.js" file in the js folder located at sites/all/themes/mytheme/js and added a line to the mytheme.info file (scripts[] = js/myjs.js). Upon inspecting the page source of my website, I could confirm that the file was successfully loaded.

Encountering various issues, I attempted to undo these changes. I removed the scripts[] line from the mytheme.info file and deleted the js file from the js folder. In theory, my Drupal 7 site should no longer be aware of my custom js file, correct?

Despite numerous cache clearings, hard browser reloads, and restarting my xampp server, whenever I checked the page source of my site, I continued to see the reference to the supposedly removed file being loaded.

Could this be related to a database entry? Where else might Drupal store this information and persist the reference?

Additionally, when I tried adding a new js file to the .info file (e.g., "js/newjs.js") and cleared the cache, the new file did not appear. Only the old, original file was present.

I am using a bootstrap subtheme and have thoroughly checked both bootstrap.info and mytheme.info, finding NO mention of the myjs.js file whatsoever.

This situation is incredibly frustrating. Any suggestions on where I should investigate next (potentially looking into database records)?

Thank you.

Answer №1

Discovered the issue. I initially set up AMPP as my localhost server and installed D7 on what I believed to be my D: drive. However, upon further investigation, I realized that there is actually another installation on my C drive in the Systems folder. This means that I have inadvertently been working on two separate installations thinking they were one. Surprisingly, both installations are almost synchronized, so it's unclear whether the C drive version was a clone of the D drive install. Regardless, I feel foolish for not recognizing this sooner. The lesson here is to always check for simple mistakes when troubleshooting issues, as Chris G pointed out, sometimes the solution can be right in front of you. In this case, I had mistakenly uploaded the js and .info files to the wrong drive without even realizing it!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Guide on utilizing the list of names in a POST request

<td class="widht200"> <input type="text" name="agg" size="2" disabled="disabled"/> </td><td class="widht200"> <input type="text" name="agg" size="2" disabled="disabled"/></td><td class="widht200"> <input type=" ...

A guide on using JavaScript to obtain the original calculation for a specific equation once a checkbox has been unchecked

I am facing a scenario where I have two input fields. One should display the value of Quantity, and the other should display the value of Price. The first input, which is for quantity and of type number, has the disabled attribute. However, upon checking a ...

Incorporating multiple CSS style sheets within a single HTML document

As part of my assignment, I have successfully created two different CSS style sheets. The next step is to link both style sheets to a single HTML page and provide users with the option to switch between the two styles. I am wondering how to achieve this. ...

Guide to setting up the redux-form with initial values pulled from the store

I am looking to preload a Redux Form with values obtained from the store. Currently, I can populate the redux form with data directly from the reducer. However, when submitting the form, it only accepts data for clickable elements to generate the payload. ...

Exploring Object Elements using For Loop

After trying numerous methods, I am still puzzled by this issue. I have a feeling that the solution is going to be something very simple, but nevertheless, I need to ask for help. This is the function I'm dealing with: Module.load = function(a) { ...

Experiencing discrepancies in pixel height while conducting tests using Nightwatch

Let me start by sharing some details about my machine setup: Operating System: CentOS 7 Graphics Drivers: kmod-nvidia (dedicated GPU) I am currently testing a webpage using Nightwatch, and one of the requirements is to ensure that a background image&apo ...

Integrating custom non-NPM JavaScript files into Angular 2

Currently, the application I am working on is running in an environment with angular 2.0.0 final using typescript and also utilizes angular-cli 1.0.0-beta.15. Since the development of the application involves multiple developers who all use typescript, I ...

How can I adjust the scale and position of my image textures in Three.js?

Is there a way to adjust the scale and position of my image textures? The dimensions of my image are 1024px x 1024px. let textureMap = THREE.ImageUtils.loadTexture( 'texture.png' ); https://i.sstatic.net/wKd6f.jpg ...

Having trouble debugging JavaScript as a beginner? Unable to pull the cookie value and use it as a variable? Let's

Hello everyone, I'm new to coding and have been working on a project. However, I am facing some errors and need help debugging. I have a cookie named "country" with a value of "AZ" that I want to retrieve using JavaScript and use it in my Google Maps ...

Are you looking for JavaScript templating that also includes internationalization support? If so, what else are you searching

In the foreseeable future, I envision the distribution of my multilingual single-page-application. This application will house an array of resources such as videos, texts, and interactive applications for both web and desktop usage (including offline acces ...

Tips for capturing changes in a "count" variable and executing actions based on its value

I have a counter on my webpage and I'm trying to change the style of an element based on the count variable. I tried using the .change action but I haven't been able to get it working. It might not be the right solution. Can anyone provide some ...

The discord.js TypeScript is throwing an error stating that the 'index.ts' file is missing when trying to run 'ts-node index.ts'

I have been working on creating a discord bot using discord.js and TypeScript. However, when I attempt to start the bot by running 'ts-node index.ts', I encounter the following error: Error: Cannot find module 'node:events' Require stac ...

What causes the bootstrap grid system to deviate from the intended column sizes?

Here is the alignment I am aiming for with the Phone and Extension fields in the form: https://i.sstatic.net/JRmDU.png This is the code snippet I have written for the Phone and Extension row: <div class="row form-group"> ...

Working with Vue.js: Binding to dynamically generated form elements

I am facing an issue where form elements are not available in the html document until an inline script runs on page load. In Vue.js, how can I bind to these form elements after the page loads? While with jQuery I could use a $('.element').each(), ...

Looking to test form submissions in React using Jest and Enzyme? Keep running into the error "Cannot read property 'preventDefault' of undefined"?

Currently, I am developing a test to validate whether the error Notification component is displayed when the login form is submitted without any data. describe('User signin', () => { it('should fail if no credentials are provided&apos ...

Utilizing jQuery for extracting information from JSON datasets

I've been grappling with getting jQuery to interpret JSON data, but it keeps coming back as undefined. $.post( wce_data.url, { userid : userId, token : accessToken }, 'json') .done(function( data ) { consol ...

Tips for importing a different js file from an npm package without needing to include the entire node_modules path

When using the ES2016 import syntax to load the select2 library from an npm module via Webpack, everything works smoothly and the select2.js file is loaded from the node_modules directory. The node_modules directory also contains a full version of the lib ...

How to read a text file in JavaScript line by line

Coding Challenge: <script src="../scripts/jquery-3.1.0.min.js"></script> <script> $(document).ready(function(){ $('#test').click(function(){ var txtFile = '../data/mail.txt'; var file ...

Is it possible to transfer data between two child components in Vue.js that share a common parent component?

In my project, I am working with 2 components that have a shared parent. My goal is to pass data from one child component to the other effectively. (I am specifically using vueJS 2 for this task) ...

How to stop Mouseenter event from bubbling up in an unordered list of hyperlinks using Vue 3

I've experimented with various methods to prevent event bubbling on the mouseenter event, but I'm still encountering an issue. When I hover over a link, the event is triggered for all the links as if they were all being hovered over simultaneousl ...